X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d42f7b865b7f765b14f05f2561ddb2a4f1e8cee9..872ef4dde72a88ceb1358849a462f791135b842d:/sbr/read_switch_multiword.c diff --git a/sbr/read_switch_multiword.c b/sbr/read_switch_multiword.c index 047d1474..a5aedae3 100644 --- a/sbr/read_switch_multiword.c +++ b/sbr/read_switch_multiword.c @@ -25,12 +25,11 @@ read_switch_multiword (const char *prompt, const struct swit *ansp) SIGNAL_HANDLER istat = NULL; char *cp, **cpp; - if (!(sigsetjmp(sigenv, 1))) { - istat = SIGNAL (SIGINT, intrser); - } else { + if (sigsetjmp(sigenv, 1)) { SIGNAL (SIGINT, istat); return NULL; } + istat = SIGNAL (SIGINT, intrser); for (;;) { fputs(prompt, stdout); @@ -50,7 +49,7 @@ read_switch_multiword (const char *prompt, const struct swit *ansp) * then just return. */ - else if (ferror(stdin)) { + if (ferror(stdin)) { if (errno == EINTR) { clearerr(stdin); continue; @@ -58,14 +57,11 @@ read_switch_multiword (const char *prompt, const struct swit *ansp) fprintf(stderr, "\nError %s during read\n", strerror(errno)); siglongjmp (sigenv, 1); - } else { - /* - * Just for completeness's sake ... - */ - - fprintf(stderr, "\nUnknown problem in getchar()\n"); - siglongjmp (sigenv, 1); } + + /* Just for completeness's sake... */ + fprintf(stderr, "\nUnknown problem in getchar()\n"); + siglongjmp(sigenv, 1); } if (cp < &ansbuf[sizeof ansbuf - 1]) *cp++ = i;