diff options
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r-- | gdb/cli/cli-cmds.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index e3cccdf..0fc5efc 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -730,16 +730,13 @@ shell_escape (char *arg, int from_tty) if ((pid = vfork ()) == 0) { - char *p, *user_shell; + const char *p, *user_shell; if ((user_shell = (char *) getenv ("SHELL")) == NULL) user_shell = "/bin/sh"; /* Get the name of the shell for arg0. */ - if ((p = strrchr (user_shell, '/')) == NULL) - p = user_shell; - else - p++; /* Get past '/' */ + p = lbasename (user_shell); if (!arg) execl (user_shell, p, (char *) 0); |