From 8ef89cd54d98f64f593c982c00f2151a211dd878 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 15 May 2000 08:04:09 +0000 Subject: zparseopts should detect if it is called without option descriptions (11360) --- Src/Modules/zutil.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Src') 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); -- cgit 1.4.1