ok, -rHEAD shall be unbroken

This commit is contained in:
tg 2007-01-15 00:18:47 +00:00
parent 84085a8747
commit a712de8e63
3 changed files with 16 additions and 14 deletions

13
exec.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.22 2007/01/12 10:18:20 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.23 2007/01/15 00:18:47 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, char **,
int volatile);
@ -665,16 +665,17 @@ comexec(struct op *t, struct tbl *volatile tp, char **ap, volatile int flags)
static void
scriptexec(struct op *tp, char **ap)
{
static char execshell[] = "/bin/sh";
const char *sh;
sh = str_val(global("EXECSHELL"));
if (sh && *sh)
sh = search(sh, path, X_OK, NULL);
if (!sh || !*sh)
sh = "/bin/sh";
sh = execshell;
*tp->args-- = tp->str;
*tp->args = sh;
*tp->args = str_save(sh, ATEMP);
execve(tp->args[0], tp->args, ap);
@ -1194,8 +1195,10 @@ herein(const char *content, int sub)
static char *
do_selectargs(char **ap, bool print_menu)
{
static const char *const read_args[] = {
"read", "-r", "REPLY", NULL
static char read_args0[] = "read",
read_args1[] = "-r", read_args2[] = "REPLY",
*read_args[] = {
read_args0, read_args1, read_args2, NULL
};
char *s;
int i, argct;

10
funcs.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.44 2007/01/14 23:57:44 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.45 2007/01/15 00:18:47 tg Exp $");
int
c_cd(char **wp)
@ -856,9 +856,8 @@ c_alias(char **wp)
/* "hash -r" means reset all the tracked aliases.. */
if (rflag) {
static const char *const args[] = {
"unalias", "-ta", NULL
};
static char args0[] = "unalias", args1[] = "-ta",
*args[] = { args0, args1, NULL };
if (!tflag || *wp) {
shprintf("alias: -r flag can only be used with -t"
@ -1964,7 +1963,8 @@ c_set(char **wp)
char **owp = wp;
if (wp[1] == NULL) {
static const char *const args [] = { "set", "-", NULL };
static char args0[] = "set", args1[] = "-",
*args[] = { args0, args1, NULL };
return c_typeset(args);
}

7
main.c
View File

@ -13,7 +13,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.67 2007/01/12 10:18:21 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.68 2007/01/15 00:18:47 tg Exp $");
extern char **environ;
@ -82,9 +82,8 @@ main(int argc, char *argv[])
/* make sure argv[] is sane */
if (!*argv) {
static const char *empty_argv[] = {
"mksh", NULL
};
static char empty_argv0[] = "mksh",
*empty_argv[] = { empty_argv0, NULL };
argv = empty_argv;
argc = 1;