* cli/cli-script.c (insert_args): Handle NULL user_args.
gdb/testsuite/
	* gdb.base/commands.exp (stray_arg0_test): New test.
This commit is contained in:
Daniel Jacobowitz
2006-03-30 16:51:20 +00:00
parent f7060f859d
commit 61d9b92fc1
4 changed files with 35 additions and 1 deletions

View File

@ -593,6 +593,11 @@ insert_args (char *line)
char *p, *save_line, *new_line;
unsigned len, i;
/* If we are not in a user-defined function, treat $argc, $arg0, et
cetera as normal convenience variables. */
if (user_args == NULL)
return xstrdup (line);
/* First we need to know how much memory to allocate for the new line. */
save_line = line;
len = 0;