introduce MKSH_DISABLE_EXPERIMENTAL and wrap the new feature introduced

in cid 1005084678C510CF7E4 in it
This commit is contained in:
tg 2012-10-22 16:53:22 +00:00
parent c7419d9e6a
commit 574c024635
4 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.587 2012/10/21 17:38:21 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.588 2012/10/22 16:53:20 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012
@ -1492,7 +1492,7 @@ else
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.587 2012/10/21 17:38:21 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.588 2012/10/22 16:53:20 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in
@ -2300,6 +2300,7 @@ MKSH_DEFAULT_EXECSHELL "/bin/sh" (do not change)
MKSH_DEFAULT_PROFILEDIR "/etc" (do not change)
MKSH_DEFAULT_TMPDIR "/tmp" (do not change)
MKSH_DISABLE_DEPRECATED disable code paths scheduled for later removal
MKSH_DISABLE_EXPERIMENTAL disable code not yet comfy for (LTS) snapshots
MKSH_DISABLE_TTY_WARNING shut up warning about ctty if OS cant be fixed
MKSH_DONT_EMIT_IDSTRING omit RCS IDs from binary
MKSH_MIDNIGHTBSD01ASH_COMPAT set -o sh: additional compatibility quirk

6
exec.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.103 2012/10/21 21:39:01 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.104 2012/10/22 16:53:21 tg Exp $");
#ifndef MKSH_DEFAULT_EXECSHELL
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
@ -605,7 +605,7 @@ comexec(struct op *t, struct tbl * volatile tp, const char **ap,
/* go on, use the builtin */
break;
#endif
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
} else if (tp->val.f == c_trap) {
t->u.evalflags &= ~DOTCOMEXEC;
break;
@ -614,7 +614,7 @@ comexec(struct op *t, struct tbl * volatile tp, const char **ap,
break;
tp = findcom(ap[0], fcflags & (FC_BI|FC_FUNC));
}
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
if (t->u.evalflags & DOTCOMEXEC)
flags |= XEXEC;
#endif

6
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.231 2012/10/21 21:39:04 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.232 2012/10/22 16:53:22 tg Exp $");
extern char **environ;
@ -464,7 +464,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
s = pushs(SSTRINGCMDLINE, ATEMP);
if (!(s->start = s->str = argv[argi++]))
errorf("%s %s", "-c", "requires an argument");
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
while (*s->str) {
if (*s->str != ' ' && ctype(*s->str, C_QUOTE))
break;
@ -850,7 +850,7 @@ shell(Source * volatile s, volatile bool toplevel)
break;
}
}
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
else if ((s->flags & SF_MAYEXEC) && t->type == TCOM)
t->u.evalflags |= DOTCOMEXEC;
#endif

6
sh.h
View File

@ -157,7 +157,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.595 2012/10/21 21:55:05 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.596 2012/10/22 16:53:22 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/10/21"
@ -1345,7 +1345,7 @@ struct ioword {
#define DOTEMP BIT(8) /* dito: in word part of ${..[%#=?]..} */
#define DOVACHECK BIT(9) /* var assign check (for typeset, set, etc) */
#define DOMARKDIRS BIT(10) /* force markdirs behaviour */
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
#define DOTCOMEXEC BIT(11) /* not an eval flag, used by sh -c hack */
#endif
@ -1491,7 +1491,7 @@ struct source {
#define SF_ALIASEND BIT(2) /* faking space at end of alias */
#define SF_TTY BIT(3) /* type == SSTDIN & it is a tty */
#define SF_HASALIAS BIT(4) /* u.tblp valid (SALIAS, SEOF) */
#ifndef MKSH_SMALL
#if !defined(MKSH_SMALL) && !defined(MKSH_DISABLE_EXPERIMENTAL)
#define SF_MAYEXEC BIT(5) /* special sh -c optimisation hack */
#endif