[PATCH 09/13] hush: pass GLOB_NOCHECK to glob

Sascha Hauer s.hauer at pengutronix.de
Mon Apr 30 07:19:24 EDT 2012


By doing so glob will not return GLOB_NOMATCH anymore but instead
just does what fake_glob would do.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/hush.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index ea6e53b..d7ed624 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -962,11 +962,6 @@ static int xglob(o_string *dest, int flags, glob_t *pglob)
 	} else if (glob_needed(dest->data)) {
 		gr = glob(dest->data, flags, NULL, pglob);
 		debug("glob returned %d\n",gr);
-		if (gr == GLOB_NOMATCH) {
-			/* quote removal, or more accurately, backslash removal */
-			gr = fake_glob(dest->data, flags, NULL, pglob);
-			debug("globhack returned %d\n",gr);
-		}
 	} else {
 		gr = fake_glob(dest->data, flags, NULL, pglob);
 		debug("globhack returned %d\n",gr);
@@ -1172,7 +1167,7 @@ static int done_word(o_string *dest, struct p_context *ctx)
 {
 	struct child_prog *child = ctx->child;
 	glob_t *glob_target;
-	int gr, flags = 0;
+	int gr, flags = GLOB_NOCHECK;
 
 	debug("%s: %s %p\n", __func__, dest->data, child);
 	if (dest->length == 0 && !dest->nonnull) {
-- 
1.7.10




More information about the barebox mailing list