aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-setshow.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-21 03:25:56 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-21 03:25:56 +0000
commitb4b4ac0b71ae756aa805f15a6f9b0c5b79d8f398 (patch)
tree51cb257042efabc97dc1b938400f93dc4b095103 /gdb/cli/cli-setshow.c
parentac4528d236f87f0ca5a76199a2455f12101ab7f9 (diff)
downloadgdb-b4b4ac0b71ae756aa805f15a6f9b0c5b79d8f398.zip
gdb-b4b4ac0b71ae756aa805f15a6f9b0c5b79d8f398.tar.gz
gdb-b4b4ac0b71ae756aa805f15a6f9b0c5b79d8f398.tar.bz2
2005-02-20 Andrew Cagney <cagney@gnu.org>
* cli/cli-decode.c (add_setshow_optional_filename_cmd): New function. * cli/cli-setshow.c (deprecated_show_value_hack) (do_setshow_command): Handle var_optional_filename. * command.h (enum var_types): Add var_optional_filename. (add_setshow_optional_filename_cmd): Declare. * infcmd.c (notice_args_read): Use.
Diffstat (limited to 'gdb/cli/cli-setshow.c')
-rw-r--r--gdb/cli/cli-setshow.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 993ca5c..15c664d 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -102,6 +102,7 @@ deprecated_show_value_hack (struct ui_file *ignore_file,
{
case var_string:
case var_string_noescape:
+ case var_optional_filename:
case var_filename:
case var_enum:
printf_filtered ((" is \"%s\".\n"), value);
@@ -177,8 +178,14 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
*(char **) c->var = savestring (arg, strlen (arg));
break;
case var_filename:
+ case var_optional_filename:
if (arg == NULL)
- error_no_arg (_("filename to set it to."));
+ {
+ if (c->var_type == var_optional_filename)
+ arg = "";
+ else
+ error_no_arg (_("filename to set it to."));
+ }
if (*(char **) c->var != NULL)
xfree (*(char **) c->var);
*(char **) c->var = tilde_expand (arg);
@@ -298,6 +305,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
}
break;
case var_string_noescape:
+ case var_optional_filename:
case var_filename:
case var_enum:
if (*(char **) c->var)