* cli/cli-cmds.c (shell_escape): Silence warnings from old
compilers.
This commit is contained in:
parent
945d18fb9c
commit
30e942055c
2 changed files with 16 additions and 10 deletions
|
@ -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>
|
2003-06-21 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
* c-valprint.c (c_value_print): Add VALUE_OFFSET to the address
|
* c-valprint.c (c_value_print): Add VALUE_OFFSET to the address
|
||||||
|
|
|
@ -499,19 +499,20 @@ shell_escape (char *arg, int from_tty)
|
||||||
#endif
|
#endif
|
||||||
#else /* Can fork. */
|
#else /* Can fork. */
|
||||||
int rc, status, pid;
|
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)
|
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)
|
if (!arg)
|
||||||
execl (user_shell, p, 0);
|
execl (user_shell, p, 0);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue