>From b3ad6fe33263861671e19329d3a773128b220358 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 2 Jun 2014 23:11:37 +0000 Subject: [PATCH 2/2] glob.c: Undo now-unneeded return type changes --- Src/glob.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Src/glob.c b/Src/glob.c index 33b49f1..c74a560 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -297,16 +297,15 @@ statfullpath(const char *s, struct stat *st, int l) char **inserts; -/* add a match to the list. Return 1 if it was inserted, 0 otherwise. */ +/* add a match to the list */ /**/ -static int +static void insert(char *s, int checked) { struct stat buf, buf2, *bp; char *news = s; int statted = 0; - int inserted = 0; queue_signals(); inserts = NULL; @@ -317,7 +316,7 @@ insert(char *s, int checked) checked = statted = 1; if (statfullpath(s, &buf, 1)) { unqueue_signals(); - return inserted; + return; } mode = buf.st_mode; if (gf_follow) { @@ -341,7 +340,7 @@ insert(char *s, int checked) if (!statted && statfullpath(s, &buf, 1)) { unqueue_signals(); - return inserted; + return; } news = dyncat(pathbuf, news); @@ -366,7 +365,7 @@ insert(char *s, int checked) /* Try next alternative, or return if there are no more */ if (!(qo = qo->or)) { unqueue_signals(); - return inserted; + return; } qn = qo; continue; @@ -376,7 +375,7 @@ insert(char *s, int checked) } else if (!checked) { if (statfullpath(s, NULL, 1)) { unqueue_signals(); - return inserted; + return; } statted = 1; news = dyncat(pathbuf, news); @@ -436,7 +435,6 @@ insert(char *s, int checked) } matchptr++; - inserted = 1; if (++matchct == matchsz) { matchbuf = (Gmatch )realloc((char *)matchbuf, sizeof(struct gmatch) * (matchsz *= 2)); @@ -447,7 +445,7 @@ insert(char *s, int checked) break; } unqueue_signals(); - return inserted; + return; } /* Do the globbing: scanner is called recursively * @@ -455,7 +453,7 @@ insert(char *s, int checked) * tried all of it. */ /**/ -static int +static void scanner(Complist q, int shortcircuit) { Patprog p; @@ -466,7 +464,7 @@ scanner(Complist q, int shortcircuit) init_dirsav(&ds); if (!q) - return -1; + return; if ((closure = q->closure)) { /* (foo/)# - match zero or more dirs */ @@ -475,7 +473,7 @@ scanner(Complist q, int shortcircuit) else scanner(q->next, shortcircuit); if (shortcircuit && shortcircuit == matchct) - return 1; + return; } p = q->pat; /* Now the actual matching for the current path section. */ @@ -490,13 +488,13 @@ scanner(Complist q, int shortcircuit) int err; if (l >= PATH_MAX) - return -1; + return; err = lchdir(pathbuf + pathbufcwd, &ds, 0); if (err == -1) - return -1; + return; if (err) { zerr("current directory lost during glob"); - return -1; + return; } pathbufcwd = pathpos; } @@ -523,7 +521,7 @@ scanner(Complist q, int shortcircuit) if (!closure || !statfullpath("", NULL, 1)) scanner((q->closure) ? q : q->next, shortcircuit); if (shortcircuit && shortcircuit == matchct) - return 1; + return; pathbuf[pathpos = oppos] = '\0'; } } @@ -532,7 +530,7 @@ scanner(Complist q, int shortcircuit) str = dupstrpfx(str, l); insert(str, 0); if (shortcircuit && shortcircuit == matchct) - return 1; + return; } } else { /* Do pattern matching on current path section. */ @@ -543,7 +541,7 @@ scanner(Complist q, int shortcircuit) int subdirlen = 0; if (lock == NULL) - return -1; + return; while ((fn = zreaddir(lock, 1)) && !errflag) { /* prefix and suffix are zle trickery */ if (!dirs && !colonmod && @@ -624,7 +622,7 @@ scanner(Complist q, int shortcircuit) /* if the last filename component, just add it */ insert(fn, 1); if (shortcircuit && shortcircuit == matchct) - return 1; + return; } } closedir(lock); @@ -640,7 +638,7 @@ scanner(Complist q, int shortcircuit) /* scan next level */ scanner((q->closure) ? q : q->next, shortcircuit); if (shortcircuit && shortcircuit == matchct) - return 1; + return; pathbuf[pathpos = oppos] = '\0'; } hrealloc(subdirs, subdirlen, 0); @@ -654,7 +652,7 @@ scanner(Complist q, int shortcircuit) close(ds.dirfd); pathbufcwd = pbcwdsav; } - return 0; + return; } /* This function tokenizes a zsh glob pattern */ -- 1.7.10.4