sh: Add more necessary INTOFF/INTON.

This commit is contained in:
Jilles Tjoelker 2014-05-09 13:27:30 +00:00
parent 8237ba8ab3
commit bc7f6652dd
2 changed files with 6 additions and 0 deletions

View File

@ -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] == '-') {

View File

@ -475,7 +475,9 @@ getopts(char *optstr, char *optvar, char **optfirst, char ***optnext,
}
else {
out1fmt("Illegal option -%c\n", c);
INTOFF;
(void) unsetvar("OPTARG");
INTON;
}
c = '?';
goto bad;
@ -494,7 +496,9 @@ getopts(char *optstr, char *optvar, char **optfirst, char ***optnext,
}
else {
out1fmt("No arg for -%c option\n", c);
INTOFF;
(void) unsetvar("OPTARG");
INTON;
c = '?';
}
goto bad;