Running `[' with no arguments would evoke a segfault.

(main) [LBRACKET]: Move initialization of argv to
precede potential use via test_syntax_error.
This commit is contained in:
Jim Meyering committed 2003-07-16 06:43:02 +00:00
1 parent 02ba301550
commit 0049fa1eda
1 file changed
+2 -1
+2 -1
View File
@@ -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;