summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2014-05-09 13:27:30 +0000
committerjilles <jilles@FreeBSD.org>2014-05-09 13:27:30 +0000
commit6a9f9b97f66628a3136322c7d20c7360fe424419 (patch)
tree2b6738295f4d70516154fda81c81f66854a9cf4e /bin/sh
parente52a56067a55b073a394dbd74fcaed77f311dc9c (diff)
downloadFreeBSD-src-6a9f9b97f66628a3136322c7d20c7360fe424419.zip
FreeBSD-src-6a9f9b97f66628a3136322c7d20c7360fe424419.tar.gz
sh: Add more necessary INTOFF/INTON.
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/main.c2
-rw-r--r--bin/sh/options.c4
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;
OpenPOWER on IntegriCloud