about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-08-01 15:50:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-08-01 15:50:07 +0000
commitcc70b961629c7fa16223bbc7f5b700b1c35a7287 (patch)
tree0a1f337bafbbc0fc4cd25fcc475b051728881230 /Src
parent8e90d2018cc807e9381330783d923b4efaee9786 (diff)
downloadzsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.tar.gz
zsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.tar.xz
zsh-cc70b961629c7fa16223bbc7f5b700b1c35a7287.zip
17497: getopts skipped over zero-length arguments.
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c2
1 files changed, 2 insertions, 0 deletions
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++])