From dc4e75ef7ca135c836d22e380847672cf5b3773b Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Tue, 2 Sep 2003 02:36:18 +0000 Subject: move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one constant. Vodz last_patch_107 --- shell/ash.c | 2 +- shell/msh.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 521d65a..59aa336 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -3729,7 +3729,7 @@ repeat: for (ap = argv; *ap; ap++) ; ap = new = ckmalloc((ap - argv + 2) * sizeof(char *)); - *ap++ = cmd = "/bin/sh"; + *ap++ = cmd = (char *)DEFAULT_SHELL; while ((*ap++ = *argv++)) ; argv = new; diff --git a/shell/msh.c b/shell/msh.c index a142c45..31dd04f 100644 --- a/shell/msh.c +++ b/shell/msh.c @@ -668,7 +668,6 @@ static char *null = ""; static int heedint =1; static struct env e ={line, iostack, iostack-1, (xint *)NULL, FDBASE, (struct env *)NULL}; static void (*qflag)(int) = SIG_IGN; -static char shellname[] = "/bin/sh"; static int startl; static int peeksym; static int nlseen; @@ -717,7 +716,7 @@ extern int msh_main(int argc, char **argv) shell = lookup("SHELL"); if (shell->value == null) - setval(shell, shellname); + setval(shell, DEFAULT_SHELL); export(shell); homedir = lookup("HOME"); @@ -2871,7 +2870,7 @@ char *c, **v, **envp; *v = e.linep; tp = *--v; *v = e.linep; - execve(shellname, v, envp); + execve(DEFAULT_SHELL, v, envp); *v = tp; return("no Shell"); @@ -3902,7 +3901,7 @@ int quoted; dup2(pf[1], 1); closepipe(pf); - argument_list[0] = shellname; + argument_list[0] = (char *)DEFAULT_SHELL; argument_list[1] = "-c"; argument_list[2] = child_cmd; argument_list[3] = 0; -- cgit v1.1