more int→bool while trying to let ^D output CR+LF (which shan’t be, oh my…)

This commit is contained in:
tg
2012-05-04 21:15:34 +00:00
parent 5780bc5eb7
commit 2d31aca859
3 changed files with 13 additions and 13 deletions

View File

@ -38,7 +38,7 @@
#endif #endif
#endif #endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.214 2012/05/04 20:49:03 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.215 2012/05/04 21:15:32 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
/* /*
@ -2295,7 +2295,7 @@ c_exitreturn(const char **wp)
} }
if (how == LEXIT && !really_exit && j_stopped_running()) { if (how == LEXIT && !really_exit && j_stopped_running()) {
really_exit = 1; really_exit = true;
how = LSHELL; how = LSHELL;
} }

16
main.c
View File

@ -34,7 +34,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.217 2012/05/04 20:49:05 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.218 2012/05/04 21:15:33 tg Exp $");
extern char **environ; extern char **environ;
@ -739,19 +739,19 @@ command(const char *comm, int line)
* run the commands from the input source, returning status. * run the commands from the input source, returning status.
*/ */
int int
shell(Source * volatile s, volatile int toplevel) shell(Source * volatile s, volatile bool toplevel)
{ {
struct op *t; struct op *t;
volatile int wastty = s->flags & SF_TTY; volatile bool wastty = tobool(s->flags & SF_TTY);
volatile int attempts = 13; volatile uint8_t attempts = 13;
volatile int interactive = Flag(FTALKING) && toplevel; volatile bool interactive = Flag(FTALKING) && toplevel;
volatile bool sfirst = true; volatile bool sfirst = true;
Source *volatile old_source = source; Source *volatile old_source = source;
int i; int i;
newenv(E_PARSE); newenv(E_PARSE);
if (interactive) if (interactive)
really_exit = 0; really_exit = false;
switch ((i = kshsetjmp(e->jbuf))) { switch ((i = kshsetjmp(e->jbuf))) {
case 0: case 0:
break; break;
@ -816,7 +816,7 @@ shell(Source * volatile s, volatile int toplevel)
s->type = SSTDIN; s->type = SSTDIN;
} else if (wastty && !really_exit && } else if (wastty && !really_exit &&
j_stopped_running()) { j_stopped_running()) {
really_exit = 1; really_exit = true;
s->type = SSTDIN; s->type = SSTDIN;
} else { } else {
/* /*
@ -834,7 +834,7 @@ shell(Source * volatile s, volatile int toplevel)
exstat = execute(t, 0, NULL); exstat = execute(t, 0, NULL);
if (t != NULL && t->type != TEOF && interactive && really_exit) if (t != NULL && t->type != TEOF && interactive && really_exit)
really_exit = 0; really_exit = false;
reclaim(); reclaim();
} }

6
sh.h
View File

@ -152,7 +152,7 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.553 2012/05/04 20:49:07 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.554 2012/05/04 21:15:34 tg Exp $");
#endif #endif
#define MKSH_VERSION "R40 2012/04/27" #define MKSH_VERSION "R40 2012/04/27"
@ -792,7 +792,7 @@ EXTERN unsigned int ksh_tmout;
EXTERN enum tmout_enum ksh_tmout_state E_INIT(TMOUT_EXECUTING); EXTERN enum tmout_enum ksh_tmout_state E_INIT(TMOUT_EXECUTING);
/* For "You have stopped jobs" message */ /* For "You have stopped jobs" message */
EXTERN int really_exit; EXTERN bool really_exit;
/* /*
* fast character classes * fast character classes
@ -1706,7 +1706,7 @@ int promptlen(const char *);
/* main.c */ /* main.c */
int include(const char *, int, const char **, int); int include(const char *, int, const char **, int);
int command(const char *, int); int command(const char *, int);
int shell(Source *volatile, int volatile); int shell(Source * volatile, volatile bool);
void unwind(int) MKSH_A_NORETURN; void unwind(int) MKSH_A_NORETURN;
void newenv(int); void newenv(int);
void quitenv(struct shf *); void quitenv(struct shf *);