about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-15 08:04:09 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-15 08:04:09 +0000
commit8ef89cd54d98f64f593c982c00f2151a211dd878 (patch)
tree185fc5bc313f9d8e97e8dc6acbedc2d958deca2c
parent6ff206e057d46095bb21aa943c383bc76cd15036 (diff)
downloadzsh-8ef89cd54d98f64f593c982c00f2151a211dd878.tar.gz
zsh-8ef89cd54d98f64f593c982c00f2151a211dd878.tar.xz
zsh-8ef89cd54d98f64f593c982c00f2151a211dd878.zip
zparseopts should detect if it is called without option descriptions (11360)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/zutil.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d7434b7ba..cc0a390cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-15  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 11360: Src/Modules/zutil.c: zparseopts should detect if it is
+ 	called without option descriptions
+	
 2000-05-15  Oliver Kiddle  <opk@zsh.org>
 
 	* 11xxx: Src/builtin.c, Src/hashtable.c, Completion/Builtins/_hash,
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index 9dd228930..5524a20e5 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -1326,13 +1326,19 @@ bin_zparseopts(char *nam, char **args, char *ops, int func)
 		}
 		break;
 	    }
-	    if (!o)
+	    if (!o) {
+		o = "";
 		break;
+	    }
 	} else {
 	    args--;
 	    break;
 	}
     }
+    if (!o) {
+	zwarnnam(nam, "missing option descriptions", NULL, 0);
+	return 1;
+    }
     while ((o = dupstring(*args++))) {
 	if (!*o) {
 	    zwarnnam(nam, "invalid option description: %s", o, 0);