From 9c8c1827d9434a91ea1c9044a8d70f285fbfd6ee Mon Sep 17 00:00:00 2001 From: tg Date: Thu, 16 Jan 2014 13:54:45 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20turn=20on=20brace=20expansion=20ear?= =?UTF-8?q?lier,=20so=20MKSH=5FBINSHREDUCED=20turns=20it=20off=20=E2=80=A2?= =?UTF-8?q?=20add=20first=20(uninstallable)=20draft=20of=20a=20dash-mksh?= =?UTF-8?q?=20package=20in=20the=20same=20=20=20spirit=20joe-jupp=20has;?= =?UTF-8?q?=20requested=20by=20Kaarlo=20=E2=80=9CjanPasi=E2=80=9D=20Poski?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/main.c b/main.c index a2acb4d..44ae7dd 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.277 2014/01/11 18:09:40 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.278 2014/01/16 13:54:45 tg Exp $"); extern char **environ; @@ -230,6 +230,23 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp) if (!*ccp) ccp = empty_argv[0]; + /* + * Turn on nohup by default. (AT&T ksh does not have a nohup + * option - it always sends the hup). + */ + Flag(FNOHUP) = 1; + + /* + * Turn on brace expansion by default. AT&T kshs that have + * alternation always have it on. + */ + Flag(FBRACEEXPAND) = 1; + + /* + * Turn on "set -x" inheritance by default. + */ + Flag(FXTRACEREC) = 1; + /* define built-in commands and see if we were called as one */ ktinit(APERM, &builtins, /* currently up to 51 builtins: 75% of 128 = 2^7 */ @@ -312,25 +329,6 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp) /* setstr can't fail here */ setstr(vp, def_path, KSH_RETURN_ERROR); - /* - * Turn on nohup by default for now - will change to off - * by default once people are aware of its existence - * (AT&T ksh does not have a nohup option - it always sends - * the hup). - */ - Flag(FNOHUP) = 1; - - /* - * Turn on brace expansion by default. AT&T kshs that have - * alternation always have it on. - */ - Flag(FBRACEEXPAND) = 1; - - /* - * Turn on "set -x" inheritance by default. - */ - Flag(FXTRACEREC) = 1; - #ifndef MKSH_NO_CMDLINE_EDITING /* * Set edit mode to emacs by default, may be overridden