aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-21 07:08:42 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-21 07:08:42 +0000
commit525226b563e98fc59a22393f2a145b7c14d6eec1 (patch)
treebb7a06e39d33d5f2850d98a2d882ab2fb83b8aaf /gdb/cli
parent4d28ad1ecec979990f27959564de1657f055b97b (diff)
downloadgdb-525226b563e98fc59a22393f2a145b7c14d6eec1.zip
gdb-525226b563e98fc59a22393f2a145b7c14d6eec1.tar.gz
gdb-525226b563e98fc59a22393f2a145b7c14d6eec1.tar.bz2
2005-02-21 Andrew Cagney <cagney@gnu.org>
Replace string variables with a filename completer with add_setshow_optional_filename_cmd. * solib.c, symfile.c: Update. * cli/cli-setshow.c: Do not tidle expand the file.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-setshow.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 4b01e62..fca92b0 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -180,15 +180,16 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
xfree (*(char **) c->var);
*(char **) c->var = savestring (arg, strlen (arg));
break;
- case var_filename:
case var_optional_filename:
if (arg == NULL)
- {
- if (c->var_type == var_optional_filename)
- arg = "";
- else
- error_no_arg (_("filename to set it to."));
- }
+ arg = "";
+ if (*(char **) c->var != NULL)
+ xfree (*(char **) c->var);
+ *(char **) c->var = savestring (arg, strlen (arg));
+ break;
+ case var_filename:
+ if (arg == NULL)
+ error_no_arg (_("filename to set it to."));
if (*(char **) c->var != NULL)
xfree (*(char **) c->var);
*(char **) c->var = tilde_expand (arg);