From a40417929cb6f94ccd8fb5af78aa47ff69a785c0 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Sun, 25 Oct 2015 23:42:03 +0900 Subject: 36911: '-optarg' should not match optspec '-opt=' Remove the requirement that -xy= should come before -x= in the list of optspecs passed to _arguments. --- Src/Zle/computil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Src/Zle/computil.c') diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index e5db0867b..db8db88a6 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1693,10 +1693,13 @@ ca_get_opt(Cadef d, char *line, int full, char **end) for (p = d->opts; p; p = p->next) if (p->active && ((!p->args || p->type == CAO_NEXT) ? !strcmp(p->name, line) : strpfx(p->name, line))) { + int l = strlen(p->name); + if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) && + line[l] && line[l] != '=') + continue; + if (end) { /* Return a pointer to the end of the option. */ - int l = strlen(p->name); - if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) && line[l] == '=') l++; -- cgit v1.2.3 From d45a68c5463224f43721371fb7bd4cbc24e62874 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 27 Oct 2015 09:28:36 +0000 Subject: 36974: fix some functions with empty argument lists --- ChangeLog | 6 ++++++ Src/Modules/zftp.c | 8 ++++---- Src/Zle/complist.c | 6 +++--- Src/Zle/computil.c | 4 ++-- Src/Zle/zle_thingy.c | 2 +- Src/parse.c | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) (limited to 'Src/Zle/computil.c') diff --git a/ChangeLog b/ChangeLog index bdd27871d..846b57ef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-10-27 Peter Stephenson + + * 36974: Src/Modules/zftp.c, Src/Zle/complist.c, + Src/Zle/computil.c, Src/Zle/zle_thingy.c, Src/parse.c: fix empty + argument lists. + 2015-10-26 Barton E. Schaefer * 36906: Kamil Dudka : Src/mem.c: diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index bd51512f9..b4081df5f 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -409,7 +409,7 @@ zfalarm(int tmout) /**/ static void -zfpipe() +zfpipe(void) { /* Just ignore SIGPIPE and rely on getting EPIPE from the write. */ signal(SIGPIPE, SIG_IGN); @@ -450,7 +450,7 @@ zfunalarm(void) /**/ static void -zfunpipe() +zfunpipe(void) { if (sigtrapped[SIGPIPE]) { if (siglists[SIGPIPE] || (sigtrapped[SIGPIPE] & ZSIG_FUNC)) @@ -1298,7 +1298,7 @@ zfstarttrans(char *nam, int recv, off_t sz) /**/ static void -zfendtrans() +zfendtrans(void) { zfunsetparam("ZFTP_SIZE"); zfunsetparam("ZFTP_FILE"); @@ -2834,7 +2834,7 @@ newsession(char *nm) /* Save the existing session: this just means saving the parameters. */ static void -savesession() +savesession(void) { char **ps, **pd, *val; diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 986ad31ea..29aaee82a 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -499,7 +499,7 @@ filecol(char *col) */ static void -getcols() +getcols(void) { char *s; int i, l; @@ -602,7 +602,7 @@ zcoff(void) static void -initiscol() +initiscol(void) { int i; @@ -1909,7 +1909,7 @@ singlecalc(int *cp, int l, int *lcp) } static void -singledraw() +singledraw(void) { Cmgroup g; int mc1, mc2, ml1, ml2, md1, md2, mcc1, mcc2, lc1, lc2, t1, t2; diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index db8db88a6..60fb096be 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -185,7 +185,7 @@ cd_group(int maxg) * descriptions. */ static void -cd_calc() +cd_calc(void) { Cdset set; Cdstr str; @@ -236,7 +236,7 @@ cd_sort(const void *a, const void *b) } static int -cd_prep() +cd_prep(void) { Cdrun run, *runp; Cdset set; diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index c6ef8e6a0..271fd8efc 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -626,7 +626,7 @@ bin_zle_complete(char *name, char **args, UNUSED(Options ops), UNUSED(char func) /**/ static int -zle_usable() +zle_usable(void) { return zleactive && !incompctlfunc && !incompfunc #if 0 diff --git a/Src/parse.c b/Src/parse.c index a26df6f0a..83ba396b0 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -530,7 +530,7 @@ empty_eprog(Eprog p) } static void -clear_hdocs() +clear_hdocs(void) { struct heredocs *p, *n; -- cgit v1.2.3