summary refs log tree commit diff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-07-13 14:06:35 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-08-13 20:53:43 +0800
commit2e5842258bd5b252ffdaa630db09c9a19a9717ca (patch)
tree7062c78c1b0187f9090994bdd5b9572c480fc2c8
parentman: Fix description of getopts when last argument reached (diff)
downloaddash-2e5842258bd5b252ffdaa630db09c9a19a9717ca.tar.gz
dash-2e5842258bd5b252ffdaa630db09c9a19a9717ca.zip
builtin: Reset t_wp_op in testcmd
The global variable t_wp_op needs to be reset every time testcmd
is called or it may cause incorrect parsing of the arguments.

Reported-by: Martijn Dekker <martijn@inlv.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--src/bltin/test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bltin/test.c b/src/bltin/test.c
index bab9a1f..58c05fe 100644
--- a/src/bltin/test.c
+++ b/src/bltin/test.c
@@ -193,6 +193,8 @@ testcmd(int argc, char **argv)
 		argv[argc] = NULL;
 	}
 
+	t_wp_op = NULL;
+
 recheck:
 	argv++;
 	argc--;