From 0049fa1eda0434a8ef0bf323217b7fe98a037531 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 16 Jul 2003 06:43:02 +0000 Subject: Running `[' with no arguments would evoke a segfault. (main) [LBRACKET]: Move initialization of argv to precede potential use via test_syntax_error. --- src/test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/test.c b/src/test.c index 1fec21f8d..3db4f93fd 100644 --- a/src/test.c +++ b/src/test.c @@ -1091,6 +1091,8 @@ main (int margc, char **margv) parse_long_options (margc, margv, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS, usage); + argv = margv; + if (LBRACKET) { --margc; @@ -1099,7 +1101,6 @@ main (int margc, char **margv) test_syntax_error (_("missing `]'\n"), NULL); } - argv = margv; argc = margc; pos = 1; -- cgit v1.2.3-70-g09d2