summaryrefslogtreecommitdiff
path: root/Src/Zle/compctl.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
committerAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
commit3e439c3863f14c82f70666804c8570a13b3732e6 (patch)
tree07036c43e0f3f9242bb6dd42cd2a849ec8ea8aca /Src/Zle/compctl.c
parent2aedc4b88fd0e87b89583983951b04b96f48efd3 (diff)
parent7b7e84f0815ed22a0ee348a217776529035dccf3 (diff)
downloadzsh-3e439c3863f14c82f70666804c8570a13b3732e6.tar.gz
zsh-3e439c3863f14c82f70666804c8570a13b3732e6.zip
Merge tag 'zsh-5.2-test-1' into debian
Diffstat (limited to 'Src/Zle/compctl.c')
-rw-r--r--Src/Zle/compctl.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 8381867d0..52c6f1233 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -1400,7 +1400,7 @@ printcompctl(char *s, Compctl cc, int printflags, int ispat)
untokenize(p);
quotedzputs(p, stdout);
} else
- quotedzputs(quotestring(s, NULL, QT_BACKSLASH), stdout);
+ quotedzputs(quotestring(s, QT_BACKSLASH), stdout);
}
/* loop through flags w/o args that are set, printing them if so */
@@ -1536,7 +1536,7 @@ printcompctl(char *s, Compctl cc, int printflags, int ispat)
char *p = dupstring(s);
untokenize(p);
- quotedzputs(quotestring(p, NULL, QT_BACKSLASH), stdout);
+ quotedzputs(quotestring(p, QT_BACKSLASH), stdout);
}
}
putchar('\n');
@@ -1740,8 +1740,8 @@ static int addwhat;
* This uses the instring variable exported from zle_tricky.c.
*/
-#define quotename(s, e) \
-quotestring(s, e, instring == QT_NONE ? QT_BACKSLASH : instring)
+#define quotename(s) \
+quotestring(s, instring == QT_NONE ? QT_BACKSLASH : instring)
/* Hook functions */
@@ -1965,7 +1965,7 @@ addmatch(char *s, char *t)
if (!ms)
return;
- if (addwhat == -7 && !findcmd(s, 0))
+ if (addwhat == -7 && !findcmd(s, 0, 0))
return;
isfile = CMF_FILE;
} else if (addwhat == CC_QUOTEFLAG || addwhat == -2 ||
@@ -2135,7 +2135,7 @@ gen_matches_files(int dirs, int execs, int all)
{
DIR *d;
struct stat buf;
- char *n, p[PATH_MAX], *q = NULL, *e, *pathpref;
+ char *n, p[PATH_MAX+1], *q = NULL, *e, *pathpref;
LinkList l = NULL;
int ns = 0, ng = opts[NULLGLOB], test, aw = addwhat, pathpreflen;
@@ -2469,7 +2469,7 @@ makecomplistcmd(char *os, int incmd, int flags)
/* If the command string starts with `=', try the path name of the *
* command. */
if (cmdstr && cmdstr[0] == Equals) {
- char *c = findcmd(cmdstr + 1, 1);
+ char *c = findcmd(cmdstr + 1, 1, 0);
if (c) {
zsfree(cmdstr);
@@ -2509,7 +2509,8 @@ makecomplistpc(char *os, int incmd)
int ret = 0;
s = ((shfunctab->getnode(shfunctab, cmdstr) ||
- builtintab->getnode(builtintab, cmdstr)) ? NULL : findcmd(cmdstr, 1));
+ builtintab->getnode(builtintab, cmdstr)) ? NULL :
+ findcmd(cmdstr, 1, 0));
for (pc = patcomps; pc; pc = pc->next) {
if ((pat = patcompile(pc->pat, PAT_STATIC, NULL)) &&
@@ -3153,10 +3154,10 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
lpre = zhalloc(lpl + 1);
memcpy(lpre, s, lpl);
lpre[lpl] = '\0';
- qlpre = quotename(lpre, NULL);
+ qlpre = quotename(lpre);
lsuf = dupstring(s + offs);
lsl = strlen(lsuf);
- qlsuf = quotename(lsuf, NULL);
+ qlsuf = quotename(lsuf);
/* First check for ~.../... */
if (ic == Tilde) {
@@ -3175,11 +3176,11 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
rpre = (*p || *lpre == Tilde || *lpre == Equals) ?
(noreal = 0, getreal(tt)) :
dupstring(tt);
- qrpre = quotename(rpre, NULL);
+ qrpre = quotename(rpre);
for (p = lsuf; *p && *p != String && *p != Tick; p++);
rsuf = *p ? (noreal = 0, getreal(lsuf)) : dupstring(lsuf);
- qrsuf = quotename(rsuf, NULL);
+ qrsuf = quotename(rsuf);
/* Check if word is a pattern. */
@@ -3315,10 +3316,10 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
/* And get the file prefix. */
fpre = dupstring(((s1 == s || s1 == rpre || ic) &&
(*s != '/' || zlemetacs == wb)) ? s1 : s1 + 1);
- qfpre = quotename(fpre, NULL);
+ qfpre = quotename(fpre);
/* And the suffix. */
fsuf = dupstrpfx(rsuf, s2 - rsuf);
- qfsuf = quotename(fsuf, NULL);
+ qfsuf = quotename(fsuf);
if (comppatmatch && *comppatmatch && (ispattern & 2)) {
int t2;
@@ -3992,7 +3993,7 @@ enables_(Module m, int **enables)
/**/
int
-boot_(Module m)
+boot_(UNUSED(Module m))
{
addhookfunc("compctl_make", (Hookfn) ccmakehookfn);
addhookfunc("compctl_cleanup", (Hookfn) cccleanuphookfn);