diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-05-10 13:28:03 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2007-05-10 13:28:03 +0000 |
commit | 1430be3e9032ac32e916de1a7e1dd360ac2ecb0a (patch) | |
tree | 268b82c364664f5a6a6d0ff0cb86def43aba8a77 | |
parent | b186458a4dce22531cdbd1374c055d4813bd811c (diff) | |
download | gdb-1430be3e9032ac32e916de1a7e1dd360ac2ecb0a.zip gdb-1430be3e9032ac32e916de1a7e1dd360ac2ecb0a.tar.gz gdb-1430be3e9032ac32e916de1a7e1dd360ac2ecb0a.tar.bz2 |
* cli/cli-setshow.c (do_setshow_command): Remove trailing
whitespace when setting a var_filename.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/cli/cli-setshow.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 310e648..b66475b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2007-05-10 Chris Dearman <chris@mips.com> + Maciej W. Rozycki <macro@mips.com> + + * cli/cli-setshow.c (do_setshow_command): Remove trailing + whitespace when setting a var_filename. + 2007-05-09 Bob Wilson <bob.wilson@acm.org> * main.c (captured_main): Recognize -tui option and print an error diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 8baa47b..91df9d0 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -192,6 +192,13 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) error_no_arg (_("filename to set it to.")); if (*(char **) c->var != NULL) xfree (*(char **) c->var); + { + /* Clear trailing whitespace of filename. */ + char *ptr = arg + strlen (arg) - 1; + while (ptr >= arg && (*ptr == ' ' || *ptr == '\t')) + ptr--; + *(ptr + 1) = '\0'; + } *(char **) c->var = tilde_expand (arg); break; case var_boolean: |