diff options
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/compctl.c | 125 | ||||
-rw-r--r-- | Src/Zle/complete.c | 47 | ||||
-rw-r--r-- | Src/Zle/complist.c | 3 | ||||
-rw-r--r-- | Src/Zle/computil.c | 126 | ||||
-rw-r--r-- | Src/Zle/deltochar.c | 3 | ||||
-rw-r--r-- | Src/Zle/zle_keymap.c | 42 | ||||
-rw-r--r-- | Src/Zle/zle_main.c | 23 | ||||
-rw-r--r-- | Src/Zle/zle_thingy.c | 44 | ||||
-rw-r--r-- | Src/Zle/zle_tricky.c | 2 |
9 files changed, 195 insertions, 220 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 1c994ef64..4389c434b 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -193,8 +193,7 @@ compctlread(char *name, char **args, Options ops, char *reply) /* only allowed to be called for completion */ if (!incompctlfunc) { - zwarnnam(name, "option valid only in functions called for completion", - NULL, 0); + zwarnnam(name, "option valid only in functions called for completion"); return 1; } @@ -513,14 +512,14 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) char *p; if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } if ((*argv)[1]) { p = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "retry specification expected after -%c", NULL, + zwarnnam(name, "retry specification expected after -%c", **argv); return 1; } else { @@ -542,12 +541,12 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) break; default: zwarnnam(name, "invalid retry specification character `%c'", - NULL, *p); + *p); return 1; } if (p[1]) { zwarnnam(name, "too many retry specification characters: `%s'", - p + 1, 0); + p + 1); return 1; } } @@ -557,8 +556,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.keyvar = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "variable name expected after -%c", NULL, - **argv); + zwarnnam(name, "variable name expected after -%c", **argv); return 1; } else { cct.keyvar = *++argv; @@ -570,8 +568,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.func = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "function name expected after -%c", NULL, - **argv); + zwarnnam(name, "function name expected after -%c", **argv); return 1; } else { cct.func = *++argv; @@ -588,7 +585,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.explain = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "string expected after -%c", NULL, **argv); + zwarnnam(name, "string expected after -%c", **argv); return 1; } else { cct.explain = *++argv; @@ -601,7 +598,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) *argv = "" - 1; } else if (!argv[1]) { zwarnnam(name, "function/variable expected after -%c", - NULL, **argv); + **argv); } else { cct.ylist = *++argv; *argv = "" - 1; @@ -612,7 +609,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.prefix = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "string expected after -%c", NULL, **argv); + zwarnnam(name, "string expected after -%c", **argv); return 1; } else { cct.prefix = *++argv; @@ -624,7 +621,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.suffix = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "string expected after -%c", NULL, **argv); + zwarnnam(name, "string expected after -%c", **argv); return 1; } else { cct.suffix = *++argv; @@ -636,8 +633,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.glob = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "glob pattern expected after -%c", NULL, - **argv); + zwarnnam(name, "glob pattern expected after -%c", **argv); return 1; } else { cct.glob = *++argv; @@ -649,8 +645,8 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.str = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "command string expected after -%c", NULL, - **argv); + zwarnnam(name, "command string expected after -%c", + **argv); return 1; } else { cct.str = *++argv; @@ -659,14 +655,13 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) break; case 'l': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } else if ((*argv)[1]) { cct.subcmd = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "command name expected after -%c", NULL, - **argv); + zwarnnam(name, "command name expected after -%c", **argv); return 1; } else { cct.subcmd = *++argv; @@ -675,14 +670,13 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) break; case 'h': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } else if ((*argv)[1]) { cct.substr = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "command name expected after -%c", NULL, - **argv); + zwarnnam(name, "command name expected after -%c", **argv); return 1; } else { cct.substr = *++argv; @@ -694,8 +688,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.withd = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "path expected after -%c", NULL, - **argv); + zwarnnam(name, "path expected after -%c", **argv); return 1; } else { cct.withd = *++argv; @@ -707,8 +700,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.gname = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "group name expected after -%c", NULL, - **argv); + zwarnnam(name, "group name expected after -%c", **argv); return 1; } else { cct.gname = *++argv; @@ -720,8 +712,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) cct.gname = (*argv) + 1; *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "group name expected after -%c", NULL, - **argv); + zwarnnam(name, "group name expected after -%c", **argv); return 1; } else { cct.gname = *++argv; @@ -750,8 +741,8 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) } *argv = "" - 1; } else if (!argv[1]) { - zwarnnam(name, "matching specification expected after -%c", NULL, - **argv); + zwarnnam(name, "matching specification expected after -%c", + **argv); return 1; } else { if ((cct.matcher = @@ -770,13 +761,11 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) else if (argv[1]) cct.hnum = atoi(*++argv); else { - zwarnnam(name, "number expected after -%c", NULL, - **argv); + zwarnnam(name, "number expected after -%c", **argv); return 1; } if (!argv[1]) { - zwarnnam(name, "missing pattern after -%c", NULL, - **argv); + zwarnnam(name, "missing pattern after -%c", **argv); return 1; } cct.hpat = *++argv; @@ -788,63 +777,59 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) break; case 'C': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } if (first && !hx) { cclist |= COMP_COMMAND; } else { - zwarnnam(name, "misplaced command completion (-C) flag", - NULL, 0); + zwarnnam(name, "misplaced command completion (-C) flag"); return 1; } break; case 'D': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } if (first && !hx) { isdef = 1; cclist |= COMP_DEFAULT; } else { - zwarnnam(name, "misplaced default completion (-D) flag", - NULL, 0); + zwarnnam(name, "misplaced default completion (-D) flag"); return 1; } break; case 'T': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } if (first && !hx) { cclist |= COMP_FIRST; } else { - zwarnnam(name, "misplaced first completion (-T) flag", - NULL, 0); + zwarnnam(name, "misplaced first completion (-T) flag"); return 1; } break; case 'L': if (cl) { - zwarnnam(name, "illegal option -%c", NULL, **argv); + zwarnnam(name, "illegal option -%c", **argv); return 1; } if (!first || hx) { - zwarnnam(name, "illegal use of -L flag", NULL, 0); + zwarnnam(name, "illegal use of -L flag"); return 1; } cclist |= COMP_LIST; break; case 'x': if (cl) { - zwarnnam(name, "extended completion not allowed", NULL, 0); + zwarnnam(name, "extended completion not allowed"); return 1; } if (!argv[1]) { - zwarnnam(name, "condition expected after -%c", NULL, - **argv); + zwarnnam(name, "condition expected after -%c", **argv); return 1; } if (first) { @@ -856,8 +841,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) } ready = 2; } else { - zwarnnam(name, "recursive extended completion not allowed", - NULL, 0); + zwarnnam(name, "recursive extended completion not allowed"); return 1; } break; @@ -865,7 +849,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) if (!first && (**argv == '-' || **argv == '+') && !argv[0][1]) (*argv)--, argv--, ready = 1; else { - zwarnnam(name, "bad option: -%c", NULL, **argv); + zwarnnam(name, "bad option: -%c", **argv); return 1; } } @@ -874,7 +858,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) if (*++argv && (!ready || ready == 2) && **argv == '+' && !argv[0][1]) { if (cl) { - zwarnnam(name, "xor'ed completion illegal", NULL, 0); + zwarnnam(name, "xor'ed completion illegal"); return 1; } /* There's an alternative (+) completion: assign @@ -892,8 +876,7 @@ get_compctl(char *name, char ***av, Compctl cc, int first, int isdef, int cl) /* No argument to +, which means do default completion */ if (isdef) zwarnnam(name, - "recursive xor'd default completions not allowed", - NULL, 0); + "recursive xor'd default completions not allowed"); else cc->xor = &cc_default; } else { @@ -983,7 +966,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) break; default: t[1] = '\0'; - zwarnnam(name, "unknown condition code: %s", t, 0); + zwarnnam(name, "unknown condition code: %s", t); zfree(m, sizeof(struct compcond)); return 1; @@ -991,7 +974,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) /* Now get the arguments in square brackets */ if (t[1] != '[') { t[1] = '\0'; - zwarnnam(name, "expected condition after condition code: %s", t, 0); + zwarnnam(name, "expected condition after condition code: %s", t); zfree(m, sizeof(struct compcond)); return 1; @@ -1016,7 +999,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) if (l) { t[1] = '\0'; - zwarnnam(name, "error after condition code: %s", t, 0); + zwarnnam(name, "error after condition code: %s", t); zfree(m, sizeof(struct compcond)); return 1; @@ -1050,7 +1033,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) /* p[...] or m[...]: one or two numbers expected */ for (; *t && *t != '\201' && *t != '\200'; t++); if (!(sav = *t)) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1064,7 +1047,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) tt = ++t; for (; *t && *t != '\200'; t++); if (!*t) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1079,7 +1062,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) if (*t == '\201') *t = ','; if (!*t) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1092,7 +1075,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) /* -r[..,..] or -R[..,..]: two strings expected */ for (; *t && *t != '\201' && *t != '\200'; t++); if (!*t) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1106,7 +1089,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) if (*t == '\201') *t = ','; if (!*t) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1119,7 +1102,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) /* remaining patterns are number followed by string */ for (; *t && *t != '\200' && *t != '\201'; t++); if (!*t || *t == '\200') { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1130,7 +1113,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) if (*t == '\201') *t = ','; if (!*t) { - zwarnnam(name, "error in condition", NULL, 0); + zwarnnam(name, "error in condition"); freecompcond(m); return 1; } @@ -1167,7 +1150,7 @@ get_xcompctl(char *name, char ***av, Compctl cc, int isdef) */ if (!argv || !*argv || **argv != '-' || ((!argv[0][1] || argv[0][1] == '+') && !argv[1])) { - zwarnnam(name, "missing command names", NULL, 0); + zwarnnam(name, "missing command names"); return 1; } if (!strcmp(*argv, "--")) @@ -1201,7 +1184,7 @@ cc_assign(char *name, Compctl *ccptr, Compctl cct, int reass) || cclist == (COMP_COMMAND|COMP_FIRST) || cclist == (COMP_DEFAULT|COMP_FIRST) || cclist == COMP_SPECIAL) { - zwarnnam(name, "can't set -D, -T, and -C simultaneously", NULL, 0); + zwarnnam(name, "can't set -D, -T, and -C simultaneously"); /* ... because the following code wouldn't work. */ return 1; } @@ -1648,7 +1631,7 @@ bin_compctl(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) n = NULL; } if (n) { - zwarnnam(name, "no compctl defined for %s", n, 0); + zwarnnam(name, "no compctl defined for %s", n); ret = 1; } } @@ -1669,7 +1652,7 @@ bin_compctl(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) /* Ideally we'd handle this properly, setting both the * * special and normal completions. For the moment, * * this is better than silently failing. */ - zwarnnam(name, "extraneous commands ignored", NULL, 0); + zwarnnam(name, "extraneous commands ignored"); else compctl_process_cc(argv, cc); } @@ -1686,7 +1669,7 @@ static int bin_compcall(char *name, UNUSED(char **argv), Options ops, UNUSED(int func)) { if (incompfunc != 1) { - zwarnnam(name, "can only be called from completion function", NULL, 0); + zwarnnam(name, "can only be called from completion function"); return 1; } return makecomplistctl((OPT_ISSET(ops,'T') ? 0 : CFN_FIRST) | diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 1da9c7f19..46e9a06d8 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -213,18 +213,18 @@ parse_cmatcher(char *name, char *s) default: if (name) zwarnnam(name, "unknown match specification character `%c'", - NULL, *s); + *s); return pcm_err; } if (s[1] != ':') { if (name) - zwarnnam(name, "missing `:'", NULL, 0); + zwarnnam(name, "missing `:'"); return pcm_err; } s += 2; if (!*s) { if (name) - zwarnnam(name, "missing patterns", NULL, 0); + zwarnnam(name, "missing patterns"); return pcm_err; } if ((fl & CMF_LEFT) && !fl2) { @@ -237,7 +237,7 @@ parse_cmatcher(char *name, char *s) if (!*s || !*++s) { if (name) - zwarnnam(name, "missing line pattern", NULL, 0); + zwarnnam(name, "missing line pattern"); return pcm_err; } } else @@ -256,11 +256,11 @@ parse_cmatcher(char *name, char *s) } if ((fl & CMF_RIGHT) && !fl2 && (!*s || !*++s)) { if (name) - zwarnnam(name, "missing right anchor", NULL, 0); + zwarnnam(name, "missing right anchor"); } else if (!(fl & CMF_RIGHT) || fl2) { if (!*s) { if (name) - zwarnnam(name, "missing word pattern", NULL, 0); + zwarnnam(name, "missing word pattern"); return pcm_err; } s++; @@ -278,7 +278,7 @@ parse_cmatcher(char *name, char *s) return pcm_err; if (!*s) { if (name) - zwarnnam(name, "missing word pattern", NULL, 0); + zwarnnam(name, "missing word pattern"); return pcm_err; } s++; @@ -288,7 +288,7 @@ parse_cmatcher(char *name, char *s) if (*s == '*') { if (!(fl & (CMF_LEFT | CMF_RIGHT))) { if (name) - zwarnnam(name, "need anchor for `*'", NULL, 0); + zwarnnam(name, "need anchor for `*'"); return pcm_err; } word = NULL; @@ -302,8 +302,7 @@ parse_cmatcher(char *name, char *s) if (!word && !line) { if (name) - zwarnnam(name, "need non-empty word or line pattern", - NULL, 0); + zwarnnam(name, "need non-empty word or line pattern"); return pcm_err; } } @@ -353,7 +352,7 @@ parse_pattern(char *name, char **sp, int *lp, char e, int *err) s = parse_class(n, s + 1, ']'); if (!*s) { *err = 1; - zwarnnam(name, "unterminated character class", NULL, 0); + zwarnnam(name, "unterminated character class"); return NULL; } } else if (*s == '{') { @@ -361,14 +360,14 @@ parse_pattern(char *name, char **sp, int *lp, char e, int *err) s = parse_class(n, s + 1, '}'); if (!*s) { *err = 1; - zwarnnam(name, "unterminated character class", NULL, 0); + zwarnnam(name, "unterminated character class"); return NULL; } } else if (*s == '?') { memset(n->tab, 1, 256); } else if (*s == '*' || *s == '(' || *s == ')' || *s == '=') { *err = 1; - zwarnnam(name, "invalid pattern character `%c'", NULL, *s); + zwarnnam(name, "invalid pattern character `%c'", *s); return NULL; } else { if (*s == '\\' && s[1]) @@ -429,7 +428,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) Cmatcher match = NULL; if (incompfunc != 1) { - zwarnnam(name, "can only be called from completion function", NULL, 0); + zwarnnam(name, "can only be called from completion function"); return 1; } dat.ipre = dat.isuf = dat.ppre = dat.psuf = dat.prpre = dat.mesg = @@ -581,11 +580,11 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) dat.dummies = atoi(*argv); p = "" - 1; } else { - zwarnnam(name, "number expected after -%c", NULL, *p); + zwarnnam(name, "number expected after -%c", *p); return 1; } if (dat.dummies < 0) { - zwarnnam(name, "invalid number: %d", NULL, dat.dummies); + zwarnnam(name, "invalid number: %d", dat.dummies); return 1; } break; @@ -593,7 +592,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) argv++; goto ca_args; default: - zwarnnam(name, "bad option: -%c", NULL, *p); + zwarnnam(name, "bad option: -%c", *p); return 1; } if (sp) { @@ -607,7 +606,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) *sp = *argv; p = "" - 1; } else { - zwarnnam(name, e, NULL, *p); + zwarnnam(name, e, *p); return 1; } if (dm) { @@ -904,11 +903,11 @@ bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) char *sa = NULL, *sb = NULL; if (incompfunc != 1) { - zwarnnam(name, "can only be called from completion function", NULL, 0); + zwarnnam(name, "can only be called from completion function"); return 1; } if (argv[0][0] != '-') { - zwarnnam(name, "missing option", NULL, 0); + zwarnnam(name, "missing option"); return 1; } switch (argv[0][1]) { @@ -920,7 +919,7 @@ bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) case 'S': test = CVT_SUFPAT; break; case 'q': return set_comp_sep(); default: - zwarnnam(name, "bad option -%c", NULL, argv[0][1]); + zwarnnam(name, "bad option -%c", argv[0][1]); return 1; } if (argv[0][2]) { @@ -929,7 +928,7 @@ bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) na = 2; } else { if (!(sa = argv[1])) { - zwarnnam(name, "missing string for option -%c", NULL, argv[0][1]); + zwarnnam(name, "missing string for option -%c", argv[0][1]); return 1; } sb = argv[2]; @@ -937,7 +936,7 @@ bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) } if (((test == CVT_PRENUM || test == CVT_SUFNUM) ? !!sb : (sb && argv[na]))) { - zwarnnam(name, "too many arguments", NULL, 0); + zwarnnam(name, "too many arguments"); return 1; } switch (test) { @@ -1390,7 +1389,7 @@ static int comp_check(void) { if (incompfunc != 1) { - zerr("condition can only be used in completion function", NULL, 0); + zerr("condition can only be used in completion function"); return 0; } return 1; diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index e380f5762..0bea231c5 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -3076,8 +3076,7 @@ boot_(Module m) w_menuselect = addzlefunction("menu-select", menuselect, ZLE_MENUCMP|ZLE_KEEPSUFFIX|ZLE_ISCOMP); if (!w_menuselect) { - zwarnnam(m->nam, "name clash when adding ZLE function `menu-select'", - NULL, 0); + zwarnnam(m->nam, "name clash when adding ZLE function `menu-select'"); return -1; } addhookfunc("comp_list_matches", (Hookfn) complistmatches); diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index af813a376..fab854736 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -465,7 +465,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, set->strs = NULL; if (!(ap = get_user_var(*args))) { - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); zsfree(cd_state.sep); freecdsets(cd_state.sets); return 1; @@ -495,7 +495,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, if (*++args && **args != '-') { if (!(ap = get_user_var(*args))) { - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); zsfree(cd_state.sep); freecdsets(cd_state.sets); return 1; @@ -722,31 +722,31 @@ bin_compdescribe(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) int n = arrlen(args); if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (!args[0][0] || !args[0][1] || args[0][2]) { - zwarnnam(nam, "invalid argument: %s", args[0], 0); + zwarnnam(nam, "invalid argument: %s", args[0]); return 1; } switch (args[0][1]) { case 'i': if (n < 3) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return 1; } return cd_init(nam, args[1], args[2], "", NULL, args + 3, 0); case 'I': if (n < 6) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return 1; } else { char **opts; if (!(opts = getaparam(args[4]))) { - zwarnnam(nam, "unknown parameter: %s", args[4], 0); + zwarnnam(nam, "unknown parameter: %s", args[4]); return 1; } return cd_init(nam, args[1], args[2], args[3], opts, args + 5, 1); @@ -755,16 +755,16 @@ bin_compdescribe(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) if (cd_parsed) { if (n != 5) { zwarnnam(nam, (n < 5 ? "not enough arguments" : - "too many arguments"), NULL, 0); + "too many arguments")); return 1; } return cd_get(args + 1); } else { - zwarnnam(nam, "no parsed state", NULL, 0); + zwarnnam(nam, "no parsed state"); return 1; } } - zwarnnam(nam, "invalid option: %s", args[0], 0); + zwarnnam(nam, "invalid option: %s", args[0]); return 1; } @@ -1199,7 +1199,7 @@ parse_cadef(char *nam, char **args) /* Oops, end-of-string. */ if (*p != ')') { freecadef(all); - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); return NULL; } if (doset && axor) @@ -1252,7 +1252,7 @@ parse_cadef(char *nam, char **args) } if (!p[1]) { freecadef(all); - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); return NULL; } @@ -1289,7 +1289,7 @@ parse_cadef(char *nam, char **args) if (!*p) { freecadef(all); - zwarnnam(nam, "invalid option definition: %s", *args, 0); + zwarnnam(nam, "invalid option definition: %s", *args); return NULL; } *p++ = '\0'; @@ -1299,7 +1299,7 @@ parse_cadef(char *nam, char **args) if (c && c != ':') { freecadef(all); - zwarnnam(nam, "invalid option definition: %s", *args, 0); + zwarnnam(nam, "invalid option definition: %s", *args); return NULL; } /* Add the option name to the xor list if not `*-...'. */ @@ -1345,7 +1345,7 @@ parse_cadef(char *nam, char **args) freecadef(all); freecaargs(oargs); zwarnnam(nam, "invalid option definition: %s", - *args, 0); + *args); return NULL; } if (*++p == ':') { @@ -1429,12 +1429,12 @@ parse_cadef(char *nam, char **args) if (*++p != ':') { freecadef(all); - zwarnnam(nam, "invalid rest argument definition: %s", *args, 0); + zwarnnam(nam, "invalid rest argument definition: %s", *args); return NULL; } if (ret->rest) { freecadef(all); - zwarnnam(nam, "doubled rest argument definition: %s", *args, 0); + zwarnnam(nam, "doubled rest argument definition: %s", *args); return NULL; } if (*++p == ':') { @@ -1469,7 +1469,7 @@ parse_cadef(char *nam, char **args) if (*p != ':') { freecadef(all); - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); return NULL; } if (*++p == ':') { @@ -1490,7 +1490,7 @@ parse_cadef(char *nam, char **args) if (tmp && tmp->num == anum - 1) { freecadef(all); freecaargs(arg); - zwarnnam(nam, "doubled argument definition: %s", *args, 0); + zwarnnam(nam, "doubled argument definition: %s", *args); return NULL; } arg->next = tmp; @@ -2265,15 +2265,15 @@ bin_comparguments(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) Castate lstate = &ca_laststate; if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (args[0][0] != '-' || !args[0][1] || args[0][2]) { - zwarnnam(nam, "invalid argument: %s", args[0], 0); + zwarnnam(nam, "invalid argument: %s", args[0]); return 1; } if (args[0][1] != 'i' && args[0][1] != 'I' && !ca_parsed) { - zwarnnam(nam, "no parsed state", NULL, 0); + zwarnnam(nam, "no parsed state"); return 1; } switch (args[0][1]) { @@ -2286,15 +2286,15 @@ bin_comparguments(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) case 'a': min = 0; max = 0; break; case 'W': min = 2; max = 2; break; default: - zwarnnam(nam, "invalid option: %s", args[0], 0); + zwarnnam(nam, "invalid option: %s", args[0]); return 1; } n = arrlen(args) - 1; if (n < min) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return 1; } else if (max >= 0 && n > max) { - zwarnnam(nam, "too many arguments", NULL, 0); + zwarnnam(nam, "too many arguments"); return 1; } switch (args[0][1]) { @@ -2678,7 +2678,7 @@ parse_cvdef(char *nam, char **args) } } if (!args[0] || !args[1]) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return NULL; } descr = *args++; @@ -2724,7 +2724,7 @@ parse_cvdef(char *nam, char **args) } if (*p != ')') { freecvdef(ret); - zwarnnam(nam, "invalid argument: %s", *args, 0); + zwarnnam(nam, "invalid argument: %s", *args); return NULL; } xor = (char **) zalloc((xnum + 2) * sizeof(char *)); @@ -2748,7 +2748,7 @@ parse_cvdef(char *nam, char **args) if (hassep && !sep && name + bs + 1 < p) { freecvdef(ret); - zwarnnam(nam, "no multi-letter values with empty separator allowed", NULL, 0); + zwarnnam(nam, "no multi-letter values with empty separator allowed"); return NULL; } /* Optional description? */ @@ -2761,7 +2761,7 @@ parse_cvdef(char *nam, char **args) if (!*p) { freecvdef(ret); - zwarnnam(nam, "invalid value definition: %s", *args, 0); + zwarnnam(nam, "invalid value definition: %s", *args); return NULL; } *p++ = '\0'; @@ -2772,7 +2772,7 @@ parse_cvdef(char *nam, char **args) } if (c && c != ':') { freecvdef(ret); - zwarnnam(nam, "invalid value definition: %s", *args, 0); + zwarnnam(nam, "invalid value definition: %s", *args); return NULL; } if (!multi) { @@ -2787,7 +2787,7 @@ parse_cvdef(char *nam, char **args) if (c == ':') { if (hassep && !sep) { freecvdef(ret); - zwarnnam(nam, "no value with argument with empty separator allowed", NULL, 0); + zwarnnam(nam, "no value with argument with empty separator allowed"); return NULL; } if (*++p == ':') { @@ -3142,15 +3142,15 @@ bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) int min, max, n; if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (args[0][0] != '-' || !args[0][1] || args[0][2]) { - zwarnnam(nam, "invalid argument: %s", args[0], 0); + zwarnnam(nam, "invalid argument: %s", args[0]); return 1; } if (args[0][1] != 'i' && !cv_parsed) { - zwarnnam(nam, "no parsed state", NULL, 0); + zwarnnam(nam, "no parsed state"); return 1; } switch (args[0][1]) { @@ -3164,15 +3164,15 @@ bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) case 'L': min = 3; max = 4; break; case 'v': min = 1; max = 1; break; default: - zwarnnam(nam, "invalid option: %s", args[0], 0); + zwarnnam(nam, "invalid option: %s", args[0]); return 1; } n = arrlen(args) - 1; if (n < min) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return 1; } else if (max >= 0 && n > max) { - zwarnnam(nam, "too many arguments", NULL, 0); + zwarnnam(nam, "too many arguments"); return 1; } switch (args[0][1]) { @@ -3357,7 +3357,7 @@ bin_compquote(char *nam, char **args, Options ops, UNUSED(int func)) Value v; if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } /* Anything to do? */ @@ -3391,10 +3391,10 @@ bin_compquote(char *nam, char **args, Options ops, UNUSED(int func)) } break; default: - zwarnnam(nam, "invalid parameter type: %s", args[-1], 0); + zwarnnam(nam, "invalid parameter type: %s", args[-1]); } } else - zwarnnam(nam, "unknown parameter: %s", args[-1], 0); + zwarnnam(nam, "unknown parameter: %s", args[-1]); unqueue_signals(); } return 0; @@ -3506,21 +3506,21 @@ bin_comptags(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) int min, max, n, level; if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (args[0][0] != '-' || !args[0][1] || (args[0][2] && (args[0][2] != '-' || args[0][3]))) { - zwarnnam(nam, "invalid argument: %s", args[0], 0); + zwarnnam(nam, "invalid argument: %s", args[0]); return 1; } level = locallevel - (args[0][2] ? 1 : 0); if (level >= MAX_TAGS) { - zwarnnam(nam, "nesting level too deep", NULL, 0); + zwarnnam(nam, "nesting level too deep"); return 1; } if (args[0][1] != 'i' && args[0][1] != 'I' && !comptags[level]) { - zwarnnam(nam, "no tags registered", NULL, 0); + zwarnnam(nam, "no tags registered"); return 1; } switch (args[0][1]) { @@ -3532,15 +3532,15 @@ bin_comptags(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) case 'S': min = 1; max = 1; break; case 'A': min = 2; max = 3; break; default: - zwarnnam(nam, "invalid option: %s", args[0], 0); + zwarnnam(nam, "invalid option: %s", args[0]); return 1; } n = arrlen(args) - 1; if (n < min) { - zwarnnam(nam, "not enough arguments", NULL, 0); + zwarnnam(nam, "not enough arguments"); return 1; } else if (max >= 0 && n > max) { - zwarnnam(nam, "too many arguments", NULL, 0); + zwarnnam(nam, "too many arguments"); return 1; } switch (args[0][1]) { @@ -3634,11 +3634,11 @@ static int bin_comptry(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (!lasttaglevel || !comptags[lasttaglevel]) { - zwarnnam(nam, "no tags registered", NULL, 0); + zwarnnam(nam, "no tags registered"); return 1; } if (*args) { @@ -4326,18 +4326,18 @@ static int bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } if (**args != '-') { - zwarnnam(nam, "missing option: %s", *args, 0); + zwarnnam(nam, "missing option: %s", *args); return 1; } switch (args[0][1]) { case 'p': case 'P': if (args[0][2] && (args[0][2] != '-' || args[0][3])) { - zwarnnam(nam, "invalid option: %s", *args, 0); + zwarnnam(nam, "invalid option: %s", *args); return 1; } else { char **tmp; @@ -4345,12 +4345,12 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) if (!args[1] || !args[2] || !args[3] || !args[4] || !args[5] || !args[6] || (args[0][1] == 'p' && !args[7])) { - zwarnnam(nam, "too few arguments", NULL, 0); + zwarnnam(nam, "too few arguments"); return 1; } queue_signals(); if (!(tmp = getaparam(args[1]))) { - zwarnnam(nam, "unknown parameter: %s", args[1], 0); + zwarnnam(nam, "unknown parameter: %s", args[1]); return 0; } for (l = newlinklist(); *tmp; tmp++) @@ -4364,18 +4364,18 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) } case 'i': if (args[0][2]) { - zwarnnam(nam, "invalid option: %s", *args, 0); + zwarnnam(nam, "invalid option: %s", *args); return 1; } else { char **tmp; LinkList l; if (!args[1] || !args[2] || !args[3] || !args[4]) { - zwarnnam(nam, "too few arguments", NULL, 0); + zwarnnam(nam, "too few arguments"); return 1; } if (args[5]) { - zwarnnam(nam, "too many arguments", NULL, 0); + zwarnnam(nam, "too many arguments"); return 1; } queue_signals(); @@ -4386,7 +4386,7 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) addlinknode(l, *tmp); if (!(tmp = getaparam(args[1]))) { unqueue_signals(); - zwarnnam(nam, "unknown parameter: %s", args[1], 0); + zwarnnam(nam, "unknown parameter: %s", args[1]); return 0; } cf_ignore(tmp, l, args[3], args[4]); @@ -4401,17 +4401,17 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) int ret = 0; if (!args[1] || !args[2]) { - zwarnnam(nam, "too few arguments", NULL, 0); + zwarnnam(nam, "too few arguments"); return 1; } if (args[3]) { - zwarnnam(nam, "too many arguments", NULL, 0); + zwarnnam(nam, "too many arguments"); return 1; } queue_signals(); if (!(tmp = getaparam(args[1]))) { unqueue_signals(); - zwarnnam(nam, "unknown parameter: %s", args[1], 0); + zwarnnam(nam, "unknown parameter: %s", args[1]); return 0; } if ((l = cf_remove_other(tmp, args[2], &ret))) @@ -4420,7 +4420,7 @@ bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) return ret; } } - zwarnnam(nam, "invalid option: %s", *args, 0); + zwarnnam(nam, "invalid option: %s", *args); return 1; } @@ -4431,7 +4431,7 @@ bin_compgroups(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) char *n; if (incompfunc != 1) { - zwarnnam(nam, "can only be called from completion function", NULL, 0); + zwarnnam(nam, "can only be called from completion function"); return 1; } SWITCHHEAPS(oldheap, compheap) { diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c index 66b4aeccd..e7bfabfd3 100644 --- a/Src/Zle/deltochar.c +++ b/Src/Zle/deltochar.c @@ -94,8 +94,7 @@ boot_(Module m) return 0; deletezlefunction(w_deletetochar); } - zwarnnam(m->nam, "deltochar: name clash when adding ZLE functions", - NULL, 0); + zwarnnam(m->nam, "deltochar: name clash when adding ZLE functions"); return -1; } diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index eb47ed7ce..5b6b7f05b 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -659,18 +659,17 @@ bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func)) if(op->o) for(opp = op; (++opp)->o; ) if(OPT_ISSET(ops,STOUC(opp->o))) { - zwarnnam(name, "incompatible operation selection options", - NULL, 0); + zwarnnam(name, "incompatible operation selection options"); return 1; } n = OPT_ISSET(ops,'e') + OPT_ISSET(ops,'v') + OPT_ISSET(ops,'a') + OPT_ISSET(ops,'M'); if(!op->selp && n) { - zwarnnam(name, "keymap cannot be selected with -%c", NULL, op->o); + zwarnnam(name, "keymap cannot be selected with -%c", op->o); return 1; } if(n > 1) { - zwarnnam(name, "incompatible keymap selection options", NULL, 0); + zwarnnam(name, "incompatible keymap selection options"); return 1; } @@ -688,7 +687,7 @@ bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func)) kmname = "main"; km = openkeymap(kmname); if(!km) { - zwarnnam(name, "no such keymap `%s'", kmname, 0); + zwarnnam(name, "no such keymap `%s'", kmname); return 1; } if(OPT_ISSET(ops,'e') || OPT_ISSET(ops,'v')) @@ -708,10 +707,10 @@ bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func)) /* check number of arguments */ for(n = 0; argv[n]; n++) ; if(n < op->min) { - zwarnnam(name, "not enough arguments for -%c", NULL, op->o); + zwarnnam(name, "not enough arguments for -%c", op->o); return 1; } else if(op->max != -1 && n > op->max) { - zwarnnam(name, "too many arguments for -%c", NULL, op->o); + zwarnnam(name, "too many arguments for -%c", op->o); return 1; } @@ -767,9 +766,9 @@ bin_bindkey_del(char *name, UNUSED(char *kmname), UNUSED(Keymap km), char **argv do { int r = unlinkkeymap(*argv, 0); if(r == 1) - zwarnnam(name, "keymap name `%s' is protected", *argv, 0); + zwarnnam(name, "keymap name `%s' is protected", *argv); else if(r == 2) - zwarnnam(name, "no such keymap `%s'", *argv, 0); + zwarnnam(name, "no such keymap `%s'", *argv); ret |= !!r; } while(*++argv); return ret; @@ -783,10 +782,10 @@ bin_bindkey_link(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSE { km = openkeymap(argv[0]); if(!km) { - zwarnnam(name, "no such keymap `%s'", argv[0], 0); + zwarnnam(name, "no such keymap `%s'", argv[0]); return 1; } else if(linkkeymap(km, argv[1], 0)) { - zwarnnam(name, "keymap name `%s' is protected", argv[1], 0); + zwarnnam(name, "keymap name `%s' is protected", argv[1]); return 1; } return 0; @@ -801,13 +800,13 @@ bin_bindkey_new(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSED KeymapName kmn = (KeymapName) keymapnamtab->getnode(keymapnamtab, argv[0]); if(kmn && (kmn -> flags & KMN_IMMORTAL)) { - zwarnnam(name, "keymap name `%s' is protected", argv[0], 0); + zwarnnam(name, "keymap name `%s' is protected", argv[0]); return 1; } if(argv[1]) { km = openkeymap(argv[1]); if(!km) { - zwarnnam(name, "no such keymap `%s'", argv[0], 0); + zwarnnam(name, "no such keymap `%s'", argv[0]); return 1; } } else @@ -831,12 +830,11 @@ bin_bindkey_meta(char *name, char *kmname, Keymap km, UNUSED(char **argv), UNUSE Thingy fn; if(km->flags & KM_IMMUTABLE) { - zwarnnam(name, "keymap `%s' is protected", kmname, 0); + zwarnnam(name, "keymap `%s' is protected", kmname); return 1; } #ifdef MULTIBYTE_SUPPORT - zwarnnam(name, "warning: `bindkey -m' disables multibyte support", - NULL, 0); + zwarnnam(name, "warning: `bindkey -m' disables multibyte support"); #endif for(i = 128; i < 256; i++) if(metabind[i - 128] != z_undefinedkey) { @@ -867,12 +865,12 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops, for(a = argv+2; *a; a++) if(!*++a) { - zwarnnam(name, "even number of arguments required", NULL, 0); + zwarnnam(name, "even number of arguments required"); return 1; } } if(km->flags & KM_IMMUTABLE) { - zwarnnam(name, "keymap `%s' is protected", kmname, 0); + zwarnnam(name, "keymap `%s' is protected", kmname); return 1; } if (func == 'r' && OPT_ISSET(ops,'p')) { @@ -912,7 +910,7 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops, if(len < 2 || len > 2 + (bseq[1] == '-') || (first = STOUC(bseq[0])) > (last = STOUC(bseq[len - 1]))) { - zwarnnam(name, "malformed key range `%s'", useq, 0); + zwarnnam(name, "malformed key range `%s'", useq); ret = 1; } else { for(; first <= last; first++) { @@ -924,7 +922,7 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops, } } else { if(bindkey(km, seq, fn, str)) { - zwarnnam(name, "cannot bind to an empty key sequence", NULL, 0); + zwarnnam(name, "cannot bind to an empty key sequence"); ret = 1; } } @@ -974,7 +972,7 @@ bin_bindkey_list(char *name, char *kmname, Keymap km, char **argv, Options ops, /* empty prefix is equivalent to no prefix */ if (OPT_ISSET(ops,'p') && (!argv[0] || argv[0][0])) { if (!argv[0]) { - zwarnnam(name, "option -p requires a prefix string", NULL, 0); + zwarnnam(name, "option -p requires a prefix string"); return 1; } bs.prefix = getkeystring(argv[0], &bs.prefixlen, 2, NULL); @@ -1408,7 +1406,7 @@ getkeycmd(void) char *pb; if (++hops == 20) { - zerr("string inserting another one too many times", NULL, 0); + zerr("string inserting another one too many times"); hops = 0; return NULL; } diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 6ba1fbab6..1c82611c2 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -701,7 +701,7 @@ getbyte(int keytmout, int *timeout) opts[MONITOR] = ret; die = 1; } else if (errno != 0) { - zerr("error on TTY read: %e", NULL, errno); + zerr("error on TTY read: %e", errno); stopmsg = 1; zexit(1, 0); } @@ -1205,7 +1205,7 @@ savekeymap(char *cmdname, char *oldname, char *newname, Keymap *savemapptr) } return 0; } else { - zwarnnam(cmdname, "no such keymap: %s", newname, 0); + zwarnnam(cmdname, "no such keymap: %s", newname); return 1; } } @@ -1221,7 +1221,7 @@ restorekeymap(char *cmdname, char *oldname, char *newname, Keymap savemap) } else if (newname) { /* urr... can this happen? */ zwarnnam(cmdname, - "keymap %s was not defined, not restored", oldname, 0); + "keymap %s was not defined, not restored", oldname); } } @@ -1247,11 +1247,11 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) FILE *oshout = NULL; if ((interact && unset(USEZLE)) || !strcmp(term, "emacs")) { - zwarnnam(name, "ZLE not enabled", NULL, 0); + zwarnnam(name, "ZLE not enabled"); return 1; } if (zleactive) { - zwarnnam(name, "ZLE cannot be used recursively (yet)", NULL, 0); + zwarnnam(name, "ZLE cannot be used recursively (yet)"); return 1; } @@ -1259,7 +1259,7 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) { if (OPT_ISSET(ops, 'a')) { - zwarnnam(name, "specify only one of -a and -A", NULL, 0); + zwarnnam(name, "specify only one of -a and -A"); return 1; } type = PM_HASHED; @@ -1272,7 +1272,7 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) vicmd_keymapname = OPT_ARG_SAFE(ops,'m'); if (type != PM_SCALAR && !OPT_ISSET(ops,'c')) { - zwarnnam(name, "-%s ignored", type == PM_ARRAY ? "a" : "A", 0); + zwarnnam(name, "-%s ignored", type == PM_ARRAY ? "a" : "A"); } /* handle non-existent parameter */ @@ -1282,7 +1282,7 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) SCANPM_WANTKEYS|SCANPM_WANTVALS|SCANPM_MATCHMANY); if (!v && !OPT_ISSET(ops,'c')) { unqueue_signals(); - zwarnnam(name, "no such variable: %s", args[0], 0); + zwarnnam(name, "no such variable: %s", args[0]); return 1; } else if (v) { if (v->isarr) { @@ -1331,7 +1331,7 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) unqueue_signals(); } else if (*s) { unqueue_signals(); - zwarnnam(name, "invalid parameter name: %s", args[0], 0); + zwarnnam(name, "invalid parameter name: %s", args[0]); return 1; } else { unqueue_signals(); @@ -1341,7 +1341,7 @@ bin_vared(char *name, char **args, Options ops, UNUSED(int func)) if (SHTTY == -1) { /* need to open /dev/tty specially */ if ((SHTTY = open("/dev/tty", O_RDWR|O_NOCTTY)) == -1) { - zwarnnam(name, "can't access terminal", NULL, 0); + zwarnnam(name, "can't access terminal"); return 1; } oshout = shout; @@ -1667,8 +1667,7 @@ int cleanup_(Module m) { if(zleactive) { - zerrnam(m->nam, "can't unload the zle module while zle is active", - NULL, 0); + zerrnam(m->nam, "can't unload the zle module while zle is active"); return 1; } deletehookfunc("before_trap", (Hookfn) zlebeforetrap); diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index 140aeb06a..72d3314ff 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -363,18 +363,17 @@ bin_zle(char *name, char **args, Options ops, UNUSED(int func)) if(op->o) for(opp = op; (++opp)->o; ) if(OPT_ISSET(ops,STOUC(opp->o))) { - zwarnnam(name, "incompatible operation selection options", - NULL, 0); + zwarnnam(name, "incompatible operation selection options"); return 1; } /* check number of arguments */ for(n = 0; args[n]; n++) ; if(n < op->min) { - zwarnnam(name, "not enough arguments for -%c", NULL, op->o); + zwarnnam(name, "not enough arguments for -%c", op->o); return 1; } else if(op->max != -1 && n > op->max) { - zwarnnam(name, "too many arguments for -%c", NULL, op->o); + zwarnnam(name, "too many arguments for -%c", op->o); return 1; } @@ -454,7 +453,7 @@ static int bin_zle_mesg(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { if (!zleactive) { - zwarnnam(name, "can only be called from widget function", NULL, 0); + zwarnnam(name, "can only be called from widget function"); return 1; } showmsg(*args); @@ -470,7 +469,7 @@ bin_zle_unget(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) char *b = *args, *p = b + strlen(b); if (!zleactive) { - zwarnnam(name, "can only be called from widget function", NULL, 0); + zwarnnam(name, "can only be called from widget function"); return 1; } while (p > b) @@ -483,7 +482,7 @@ static int bin_zle_keymap(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) { if (!zleactive) { - zwarnnam(name, "can only be called from widget function", NULL, 0); + zwarnnam(name, "can only be called from widget function"); return 1; } return selectkeymap(*args, 0); @@ -541,10 +540,10 @@ bin_zle_del(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) do { Thingy t = (Thingy) thingytab->getnode(thingytab, *args); if(!t) { - zwarnnam(name, "no such widget `%s'", *args, 0); + zwarnnam(name, "no such widget `%s'", *args); ret = 1; } else if(unbindwidget(t, 0)) { - zwarnnam(name, "widget name `%s' is protected", *args, 0); + zwarnnam(name, "widget name `%s' is protected", *args); ret = 1; } } while(*++args); @@ -558,10 +557,10 @@ bin_zle_link(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) Thingy t = (Thingy) thingytab->getnode(thingytab, args[0]); if(!t) { - zwarnnam(name, "no such widget `%s'", args[0], 0); + zwarnnam(name, "no such widget `%s'", args[0]); return 1; } else if(bindwidget(t->widget, rthingy(args[1]))) { - zwarnnam(name, "widget name `%s' is protected", args[1], 0); + zwarnnam(name, "widget name `%s' is protected", args[1]); return 1; } return 0; @@ -580,7 +579,7 @@ bin_zle_new(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) if(!bindwidget(w, rthingy(args[0]))) return 0; freewidget(w); - zwarnnam(name, "widget name `%s' is protected", args[0], 0); + zwarnnam(name, "widget name `%s' is protected", args[0]); return 1; } @@ -592,14 +591,14 @@ bin_zle_complete(char *name, char **args, UNUSED(Options ops), UNUSED(char func) Widget w, cw; if (!require_module(name, "zsh/complete", 0, 0)) { - zwarnnam(name, "can't load complete module", NULL, 0); + zwarnnam(name, "can't load complete module"); return 1; } t = rthingy((args[1][0] == '.') ? args[1] : dyncat(".", args[1])); cw = t->widget; unrefthingy(t); if (!cw || !(cw->flags & ZLE_ISCOMP)) { - zwarnnam(name, "invalid widget `%s'", args[1], 0); + zwarnnam(name, "invalid widget `%s'", args[1]); return 1; } w = zalloc(sizeof(*w)); @@ -610,7 +609,7 @@ bin_zle_complete(char *name, char **args, UNUSED(Options ops), UNUSED(char func) w->u.comp.func = ztrdup(args[2]); if (bindwidget(w, rthingy(args[0]))) { freewidget(w); - zwarnnam(name, "widget name `%s' is protected", args[0], 0); + zwarnnam(name, "widget name `%s' is protected", args[0]); return 1; } hascompwidgets++; @@ -648,8 +647,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) return !zle_usable(); if(!zle_usable()) { - zwarnnam(name, "widgets can only be called when ZLE is active", - NULL, 0); + zwarnnam(name, "widgets can only be called when ZLE is active"); return 1; } @@ -666,7 +664,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) case 'n': num = args[0][1] ? args[0]+1 : args[1]; if (!num) { - zwarnnam(name, "number expected after -%c", NULL, **args); + zwarnnam(name, "number expected after -%c", **args); return 1; } if (!args[0][1]) @@ -683,7 +681,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) case 'K': keymap_tmp = args[0][1] ? args[0]+1 : args[1]; if (!keymap_tmp) { - zwarnnam(name, "keymap expected after -%c", NULL, **args); + zwarnnam(name, "keymap expected after -%c", **args); return 1; } if (!args[0][1]) @@ -696,7 +694,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) setbindk = 1; break; default: - zwarnnam(name, "unknown option: %s", *args, 0); + zwarnnam(name, "unknown option: %s", *args); return 1; } } @@ -741,7 +739,7 @@ bin_zle_fd(char *name, char **args, Options ops, UNUSED(char func)) fd = (int)zstrtol(*args, &endptr, 10); if (*endptr || fd < 0) { - zwarnnam(name, "Bad file descriptor number for -F: %s", *args, 0); + zwarnnam(name, "Bad file descriptor number for -F: %s", *args); return 1; } } @@ -749,7 +747,7 @@ bin_zle_fd(char *name, char **args, Options ops, UNUSED(char func)) if (OPT_ISSET(ops,'L') || !*args) { /* Listing handlers. */ if (*args && args[1]) { - zwarnnam(name, "too many arguments for -FL", NULL, 0); + zwarnnam(name, "too many arguments for -FL"); return 1; } for (i = 0; i < nwatch; i++) { @@ -824,7 +822,7 @@ bin_zle_fd(char *name, char **args, Options ops, UNUSED(char func)) } } if (!found) { - zwarnnam(name, "No handler installed for fd %d", NULL, fd); + zwarnnam(name, "No handler installed for fd %d", fd); return 1; } } diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index ee4bfbb7f..250804648 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -581,7 +581,7 @@ docomplete(int lst) int olst = lst, chl = 0, ne = noerrs, ocs, ret = 0, dat[2]; if (active && !comprecursive) { - zwarn("completion cannot be used recursively (yet)", NULL, 0); + zwarn("completion cannot be used recursively (yet)"); return 1; } active = 1; |