# HG changeset patch # User Chong Yidong # Date 1237650809 0 # Node ID 531ffc32a1a2a5e135186ba7bd9975caff239f06 # Parent ee70b5a7438e97d156cdb070f7732733f1e24729 (file-modes-rights-to-number): Doc fix. (file-modes-symbolic-to-number): Handle empty permissions arg (Bug#2729). diff -r ee70b5a7438e -r 531ffc32a1a2 lisp/files.el --- a/lisp/files.el Sat Mar 21 15:52:57 2009 +0000 +++ b/lisp/files.el Sat Mar 21 15:53:29 2009 +0000 @@ -5892,7 +5892,7 @@ (defun file-modes-rights-to-number (rights who-mask &optional from) "Convert a symbolic mode string specification to an equivalent number. -RIGHTS is the symbolic mode spec, it should match \"([+=-][rwxXstugo]+)+\". +RIGHTS is the symbolic mode spec, it should match \"([+=-][rwxXstugo]*)+\". WHO-MASK is the bit-mask specifying the category of users to which to apply the access permissions. See `file-modes-char-to-who'. FROM (or 0 if nil) gives the mode bits on which to base permissions if @@ -5920,7 +5920,7 @@ (defun file-modes-symbolic-to-number (modes &optional from) "Convert symbolic file modes to numeric file modes. MODES is the string to convert, it should match -\"[ugoa]*([+-=][rwxXstugo]+)+,...\". +\"[ugoa]*([+-=][rwxXstugo]*)+,...\". See (info \"(coreutils)File permissions\") for more information on this notation. FROM (or 0 if nil) gives the mode bits on which to base permissions if @@ -5930,7 +5930,7 @@ (let ((case-fold-search nil) (num-modes (or from 0))) (while (/= (string-to-char modes) 0) - (if (string-match "^\\([ugoa]*\\)\\([+=-][rwxXstugo]+\\)+\\(,\\|\\)" modes) + (if (string-match "^\\([ugoa]*\\)\\([+=-][rwxXstugo]*\\)+\\(,\\|\\)" modes) (let ((num-who (apply 'logior 0 (mapcar 'file-modes-char-to-who (match-string 1 modes)))))