FreeBSD Bugzilla – Attachment 119752 Details for
Bug 162396
[libc] [patch] remove loop in globpexp1()@lib/libc/gen/glob.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.42 KB, created by
Cheng-Lung Sung
on 2011-11-09 05:10:08 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Cheng-Lung Sung
Created:
2011-11-09 05:10:08 UTC
Size:
2.42 KB
patch
obsolete
>diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c >index c3d9f08..40c5808 100644 >--- a/lib/libc/gen/glob.c >+++ b/lib/libc/gen/glob.c >@@ -156,7 +156,7 @@ static int globextend(const Char *, glob_t *, size_t *); > static const Char * > globtilde(const Char *, Char *, size_t, glob_t *); > static int globexp1(const Char *, glob_t *, size_t *); >-static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); >+static int globexp2(const Char *, const Char *, glob_t *, size_t *); > static int match(Char *, Char *, Char *); > #ifdef DEBUG > static void qprintf(const char *, Char *); >@@ -240,15 +240,13 @@ static int > globexp1(const Char *pattern, glob_t *pglob, size_t *limit) > { > const Char* ptr = pattern; >- int rv; > > /* Protect a single {}, for find(1), like csh */ > if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) > return glob0(pattern, pglob, limit); > >- while ((ptr = g_strchr(ptr, LBRACE)) != NULL) >- if (!globexp2(ptr, pattern, pglob, &rv, limit)) >- return rv; >+ if ((ptr = g_strchr(ptr, LBRACE)) != NULL) >+ return globexp2(ptr, pattern, pglob, limit) > > return glob0(pattern, pglob, limit); > } >@@ -260,9 +258,10 @@ globexp1(const Char *pattern, glob_t *pglob, size_t *limit) > * If it fails then it tries to glob the rest of the pattern and returns. > */ > static int >-globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) >+globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, size_t *limit) > { > int i; >+ int rv; > Char *lm, *ls; > const Char *pe, *pm, *pm1, *pl; > Char patbuf[MAXPATHLEN]; >@@ -297,8 +296,7 @@ globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *l > > /* Non matching braces; just glob the pattern */ > if (i != 0 || *pe == EOS) { >- *rv = glob0(patbuf, pglob, limit); >- return 0; >+ return glob0(patbuf, pglob, limit); > } > > for (i = 0, pl = pm = ptr; pm <= pe; pm++) >@@ -344,7 +342,9 @@ globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *l > #ifdef DEBUG > qprintf("globexp2:", patbuf); > #endif >- *rv = globexp1(patbuf, pglob, limit); >+ rv = globexp1(patbuf, pglob, limit); >+ if (rv && rv != GLOB_NOMATCH) /* if errors occured */ >+ return rv; > > /* move after the comma, to the next string */ > pl = pm + 1; >@@ -354,7 +354,6 @@ globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *l > default: > break; > } >- *rv = 0; > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162396
: 119752