about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJun T <takimoto-j@kba.biglobe.ne.jp>2014-01-05 21:52:56 +0900
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-01-05 18:04:15 +0000
commitff650ada052fccaf4b5a7bbc3b689fa20c2378ea (patch)
tree662023c63dfe87e8896d53755e55f74898bb8aa8
parent8e0ca7842d550e0a831d502d7273cdb098df2af3 (diff)
downloadzsh-ff650ada052fccaf4b5a7bbc3b689fa20c2378ea.tar.gz
zsh-ff650ada052fccaf4b5a7bbc3b689fa20c2378ea.tar.xz
zsh-ff650ada052fccaf4b5a7bbc3b689fa20c2378ea.zip
32231: _chmod was confused by options before the mode
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_chmod6
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 05d331db5..9299afc70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-01-05  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* Jun T: 32231: Completion/Unix/Command/_chmod: was confused by
+	options before the mode argument.
+
 	* Axel Beckert: 32229: LICENCE: was not correctly referring to
 	Gnu General Public License.
 
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index 6cb310d57..5d3cb2c78 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -57,12 +57,12 @@ case "$state" in
       zmodload -F zsh/stat b:zstat 2>/dev/null
       typeset -i8 ref=$(zstat +mode $opt_args[--reference])
       _wanted files expl file _files -g "*(-.^f${ref#??})" && ret=0
-    elif [[ $words[2] = [0-7]## ]]; then
-      _wanted files expl file _files -g "*(-.^f$words[2])" && ret=0
+    elif [[ $line[1] = [0-7]## ]]; then
+      _wanted files expl file _files -g "*(-.^f$line[1])" && ret=0
     else
       local spec who op priv
       local -a specs
-      for spec in ${(s:,:)words[2]}; do
+      for spec in ${(s:,:)line[1]}; do
 	if [[ ${spec#*[+-=]} != [rwxst]## ]]; then
 	  _files && ret=0
 	  return ret