From 9f37bbcca8004e1ac5be674446c51b50b36dc94e Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 9 Mar 2011 12:48:56 +0000 Subject: * cli/cli-cmds.c (shell_escape): Use lbasename. * coffread.c (coff_start_symtab): Constify parameter. (complete_symtab): Constify `name' parameter. (coff_symtab_read): Constify `filestring' local. (coff_getfilename): Constify return and `result' local. Use lbasename. * fbsd-nat.c (fbsd_make_corefile_notes): Use lbasename. * linux-fork.c (info_checkpoints_command): Use lbasename. * linux-nat.c (linux_nat_make_corefile_notes): Use lbasename. * minsyms.c (lookup_minimal_symbol): Use lbasename. * nto-tdep.c (nto_find_and_open_solib): Use lbasename. * procfs.c (procfs_make_note_section): Use lbasename. * tui/tui-io.c (printable_part): Constity return and parameter. Use lbasename. (print_filename): Constify parameters, and local `s'. (tui_rl_display_match_list): Constify local `temp'. --- gdb/cli/cli-cmds.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gdb/cli') 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); -- cgit v1.1