about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/misc/wordexp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c
index 4a3efc7b..34fc900a 100644
--- a/src/misc/wordexp.c
+++ b/src/misc/wordexp.c
@@ -82,6 +82,8 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
 		if (we->we_offs > SIZE_MAX/sizeof(void *)/4)
 			return WRDE_NOSPACE;
 		i += we->we_offs;
+	} else {
+		we->we_offs = 0;
 	}
 
 	if (pipe(p) < 0) return WRDE_NOSPACE;