diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-29 13:55:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-30 13:08:55 +0200 |
commit | cace82b597f0e4691a808fec737b86753e49ee5c (patch) | |
tree | 5ce26228cc4ae9a442f2cbd5303597031e131b97 /lib | |
parent | f4762eb5e7d321da75911e2fcb156e4e6334f171 (diff) | |
download | barebox-cace82b597f0e4691a808fec737b86753e49ee5c.tar.gz barebox-cace82b597f0e4691a808fec737b86753e49ee5c.tar.xz |
glob: activate GLOB_NOCHECK flag
Needed for hush.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/glob.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/glob.c b/lib/glob.c index 43d2f671b5..74d2b123e3 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -209,7 +209,7 @@ int glob(const char *pattern, int flags, if (pglob->gl_pathc == oldcount) { /* No matches. */ -#ifdef CONFIG_GLOB_NOCHECK + if (flags & GLOB_NOCHECK) { size_t len = strlen(pattern) + 1; char *patcopy = (char *)xmalloc(len); @@ -232,9 +232,7 @@ int glob(const char *pattern, int flags, pglob->gl_pathv[pglob->gl_pathc++] = patcopy; pglob->gl_pathv[pglob->gl_pathc] = NULL; pglob->gl_flags = flags; - } else -#endif - { + } else { status = GLOB_NOMATCH; goto out; } @@ -367,7 +365,7 @@ static int glob_in_dir(const char *pattern, const char *directory, break; } } -#ifdef CONFIG_GLOB_NOCHECK + if (nfound == 0 && (flags & GLOB_NOCHECK)) { size_t len = strlen(pattern); nfound = 1; @@ -378,7 +376,7 @@ static int glob_in_dir(const char *pattern, const char *directory, memcpy(names->name, pattern, len); names->name[len] = '\0'; } -#endif + pglob->gl_pathv = (char **)xrealloc(pglob->gl_pathv, (pglob->gl_pathc + |