From: drow Date: Sun, 22 Jun 2003 04:23:49 +0000 (+0000) Subject: * cli/cli-cmds.c (shell_escape): Silence warnings from old X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0e3d7694101ae12345fe7f6cc83e48928678313f;p=pf3gnuchains%2Fsourceware.git * cli/cli-cmds.c (shell_escape): Silence warnings from old compilers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f24da7b26e..466885aae4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-06-22 Daniel Jacobowitz + + * cli/cli-cmds.c (shell_escape): Silence warnings from old + compilers. + 2003-06-21 Daniel Jacobowitz * c-valprint.c (c_value_print): Add VALUE_OFFSET to the address diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 312db5cbd0..45794f7599 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -499,19 +499,20 @@ shell_escape (char *arg, int from_tty) #endif #else /* Can fork. */ int rc, status, pid; - 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 '/' */ if ((pid = vfork ()) == 0) { + 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 '/' */ + if (!arg) execl (user_shell, p, 0); else