about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/builtin.c2
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++])