diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-01 15:49:54 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-01 15:49:54 +0000 |
commit | 99755244bd127189d18d1aba8a6a34bfc560caf3 (patch) | |
tree | 936c939ffe12683e1e34ea7232ccae2069426c61 /Src/builtin.c | |
parent | 330ecf3b0c37173ad39d97c0ee4ce54e531ba1e6 (diff) | |
download | zsh-99755244bd127189d18d1aba8a6a34bfc560caf3.tar.gz zsh-99755244bd127189d18d1aba8a6a34bfc560caf3.tar.xz zsh-99755244bd127189d18d1aba8a6a34bfc560caf3.zip |
17497: getopts skipped over zero-length arguments.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index c2e087706..c43751711 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3141,6 +3141,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++]) |