* cli/cli-setshow.c (do_setshow_command): Remove trailing
whitespace when setting a var_filename.
This commit is contained in:
parent
b186458a4d
commit
1430be3e90
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user