diff options
author | Daniel Jacobowitz <drow@false.org> | 2003-06-22 04:23:52 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2003-06-22 04:23:52 +0000 |
commit | 30e942055c56a839f58297bcc7612d89afbc73ff (patch) | |
tree | 04fefc3c0e7204c91d5b47b8c17a5824c7295a69 | |
parent | 945d18fb9cb76da5b3a5b7783852410400b684a5 (diff) | |
download | gdb-30e942055c56a839f58297bcc7612d89afbc73ff.zip gdb-30e942055c56a839f58297bcc7612d89afbc73ff.tar.gz gdb-30e942055c56a839f58297bcc7612d89afbc73ff.tar.bz2 |
* cli/cli-cmds.c (shell_escape): Silence warnings from old
compilers.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/cli/cli-cmds.c | 21 |
2 files changed, 16 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f24da7b..466885a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-06-22 Daniel Jacobowitz <drow@mvista.com> + + * cli/cli-cmds.c (shell_escape): Silence warnings from old + compilers. + 2003-06-21 Daniel Jacobowitz <drow@mvista.com> * 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 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 |