diff options
-rw-r--r-- | bin/sh/main.c | 2 | ||||
-rw-r--r-- | bin/sh/options.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c index e4974ea..08f234e 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -140,11 +140,13 @@ main(int argc, char *argv[]) #endif rootpid = getpid(); rootshell = 1; + INTOFF; initvar(); setstackmark(&smark); setstackmark(&smark2); procargs(argc, argv); pwd_init(iflag); + INTON; if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { diff --git a/bin/sh/options.c b/bin/sh/options.c index ad0291e..2fb8010 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -475,7 +475,9 @@ atend: } else { out1fmt("Illegal option -%c\n", c); + INTOFF; (void) unsetvar("OPTARG"); + INTON; } c = '?'; goto bad; @@ -494,7 +496,9 @@ atend: } else { out1fmt("No arg for -%c option\n", c); + INTOFF; (void) unsetvar("OPTARG"); + INTON; c = '?'; } goto bad; |