X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fgetans.c;h=f3cea2733b9fe5c5ba6fd29da03bd41ad0aa2789;hp=919fd32d66537a9b70cd0c7c7548792b503edb77;hb=fc9279e818dfc96c63a5d75a89080cc68cfe1170;hpb=714b5c530ece27ea2835a313013f5b770163403c diff --git a/sbr/getans.c b/sbr/getans.c index 919fd32..f3cea27 100644 --- a/sbr/getans.c +++ b/sbr/getans.c @@ -10,6 +10,7 @@ #include #include #include +#include static char ansbuf[BUFSIZ]; static jmp_buf sigenv; @@ -17,7 +18,7 @@ static jmp_buf sigenv; /* ** static prototypes */ -static RETSIGTYPE intrser(int); +static void intrser(int); char ** @@ -52,25 +53,25 @@ getans(char *prompt, struct swit *ansp) } cpp = brkstring(ansbuf, " ", NULL); switch (smatch(*cpp, ansp)) { - case AMBIGSW: - ambigsw(*cpp, ansp); - continue; - case UNKWNSW: - printf(" -%s unknown. Hit for help.\n", *cpp); - continue; - default: - SIGNAL(SIGINT, istat); - return cpp; + case AMBIGSW: + ambigsw(*cpp, ansp); + continue; + case UNKWNSW: + printf(" -%s unknown. Hit for help.\n", *cpp); + continue; + default: + SIGNAL(SIGINT, istat); + return cpp; } } } -static RETSIGTYPE +static void intrser(int i) { /* ** should this be siglongjmp? */ - longjmp(sigenv, 1); + close(STDIN_FILENO); }