diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-01 15:50:07 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-01 15:50:07 +0000 |
commit | cc70b961629c7fa16223bbc7f5b700b1c35a7287 (patch) | |
tree | 0a1f337bafbbc0fc4cd25fcc475b051728881230 | |
parent | 8e90d2018cc807e9381330783d923b4efaee9786 (diff) | |
download | zsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.tar.gz zsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.tar.xz zsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.zip |
17497: getopts skipped over zero-length arguments.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Src/builtin.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index a8eeab761..ddffd5e4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-08-01 Peter Stephenson <pws@csr.com> + + * 17497: Src/builtin.c: getopts skipped over zero-length arguments. + + * Dan Nelson: 17492: Src/builtin.c, Src/cond.c, Src/exec.c: + Quote output from xtrace. + 2002-08-01 Oliver Kiddle <opk@zsh.org> * 17496: Completion/Unix/Type/_diff_options: update for new options diff --git a/Src/builtin.c b/Src/builtin.c index 9bcbbb08f..5297f5960 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3518,6 +3518,8 @@ bin_getopts(char *name, char **argv, char *ops, int func) /* find place in relevant argument */ str = unmetafy(dupstring(args[zoptind - 1]), &lenstr); + if (!lenstr) /* Definitely not an option. */ + return 1; if(optcind >= lenstr) { optcind = 0; if(!args[zoptind++]) |