aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-06-22 04:23:52 +0000
committerDaniel Jacobowitz <drow@false.org>2003-06-22 04:23:52 +0000
commit30e942055c56a839f58297bcc7612d89afbc73ff (patch)
tree04fefc3c0e7204c91d5b47b8c17a5824c7295a69 /gdb/cli
parent945d18fb9cb76da5b3a5b7783852410400b684a5 (diff)
downloadgdb-30e942055c56a839f58297bcc7612d89afbc73ff.zip
gdb-30e942055c56a839f58297bcc7612d89afbc73ff.tar.gz
gdb-30e942055c56a839f58297bcc7612d89afbc73ff.tar.bz2
* cli/cli-cmds.c (shell_escape): Silence warnings from old
compilers.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 312db5c..45794f7 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