about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-08-01 15:49:54 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-08-01 15:49:54 +0000
commit99755244bd127189d18d1aba8a6a34bfc560caf3 (patch)
tree936c939ffe12683e1e34ea7232ccae2069426c61 /Src/builtin.c
parent330ecf3b0c37173ad39d97c0ee4ce54e531ba1e6 (diff)
downloadzsh-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.c2
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++])