who would’ve thought proper ^C handling be so hard?

This commit is contained in:
tg
2012-10-30 20:49:44 +00:00
parent 8caee45c60
commit 5aa7842d33
4 changed files with 20 additions and 11 deletions

7
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.236 2012/10/30 20:13:19 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.237 2012/10/30 20:49:42 tg Exp $");
extern char **environ;
@ -794,7 +794,9 @@ shell(Source * volatile s, volatile bool toplevel)
* needs FMONITOR set (not FTALKING/SF_TTY)...
*/
/* toss any input we have so far */
yyrecursive_pop(true);
s->start = s->str = null;
retrace_info = NULL;
herep = heres;
break;
}
@ -939,8 +941,7 @@ quitenv(struct shf *shf)
char *cp;
int fd;
while (e->yyrecursive_statep)
yyrecursive_pop();
yyrecursive_pop(true);
if (ep->oenv && ep->oenv->loc != ep->loc)
popblock();
if (ep->savefd != NULL) {