mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 02:35:00 +08:00
* cli/cli-cmds.c (shell_escape): Silence warnings from old
compilers.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user