From 574c024635ec74f32eff862ae54d4b7df26c6147 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 22 Oct 2012 16:53:22 +0000 Subject: [PATCH] introduce MKSH_DISABLE_EXPERIMENTAL and wrap the new feature introduced in cid 1005084678C510CF7E4 in it --- Build.sh | 5 +++-- exec.c | 6 +++--- main.c | 6 +++--- sh.h | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Build.sh b/Build.sh index 1a77c18..7b4c405 100644 --- a/Build.sh +++ b/Build.sh @@ -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 diff --git a/exec.c b/exec.c index cf8632c..cc70dbb 100644 --- a/exec.c +++ b/exec.c @@ -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 diff --git a/main.c b/main.c index 1fe19eb..7e448aa 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #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 diff --git a/sh.h b/sh.h index 2c993a6..344db1a 100644 --- a/sh.h +++ b/sh.h @@ -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