Mercurial > emacs
changeset 102682:531ffc32a1a2
(file-modes-rights-to-number): Doc fix.
(file-modes-symbolic-to-number): Handle empty permissions arg (Bug#2729).
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 21 Mar 2009 15:53:29 +0000 |
parents | ee70b5a7438e |
children | de29c03d601c |
files | lisp/files.el |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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)))))