diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-03-30 16:51:20 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-03-30 16:51:20 +0000 |
commit | 61d9b92fc1a084d43c328afbd9f9177013b226c6 (patch) | |
tree | 38193caba832176b2badf1b76be1ef75e29c313f /gdb/cli | |
parent | f7060f859d2b845bf842397baeeafbb4fca2075e (diff) | |
download | gdb-61d9b92fc1a084d43c328afbd9f9177013b226c6.zip gdb-61d9b92fc1a084d43c328afbd9f9177013b226c6.tar.gz gdb-61d9b92fc1a084d43c328afbd9f9177013b226c6.tar.bz2 |
gdb/
* cli/cli-script.c (insert_args): Handle NULL user_args.
gdb/testsuite/
* gdb.base/commands.exp (stray_arg0_test): New test.
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-script.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index b8e9d4f..b447b44 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -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; |