From 32756f78afc81bdc42b47c7bdb522c582b9d896a Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 5 Jun 2014 21:10:23 -0700 Subject: 32723: add braces around some if/else branches --- Src/glob.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Src/glob.c') diff --git a/Src/glob.c b/Src/glob.c index c6cb3d2fc..15a5f70b7 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -462,18 +462,19 @@ scanner(Complist q, int shortcircuit) int errssofar = errsfound; struct dirsav ds; - init_dirsav(&ds); if (!q) return; + init_dirsav(&ds); if ((closure = q->closure)) { /* (foo/)# - match zero or more dirs */ if (q->closure == 2) /* (foo/)## - match one or more dirs */ q->closure = 1; - else + else { scanner(q->next, shortcircuit); if (shortcircuit && shortcircuit == matchct) return; + } } p = q->pat; /* Now the actual matching for the current path section. */ @@ -518,10 +519,11 @@ scanner(Complist q, int shortcircuit) } if (add) { addpath(str, l); - if (!closure || !statfullpath("", NULL, 1)) + if (!closure || !statfullpath("", NULL, 1)) { scanner((q->closure) ? q : q->next, shortcircuit); if (shortcircuit && shortcircuit == matchct) return; + } pathbuf[pathpos = oppos] = '\0'; } } @@ -618,11 +620,12 @@ scanner(Complist q, int shortcircuit) memcpy(subdirs + subdirlen, (char *)&errsfound, sizeof(int)); subdirlen += sizeof(int); - } else + } else { /* if the last filename component, just add it */ insert(fn, 1); if (shortcircuit && shortcircuit == matchct) return; + } } } closedir(lock); -- cgit 1.4.1