Prechádzať zdrojové kódy

handle interrupted getc in falliblesubprocess() prompt

Wichert Akkerman 25 rokov pred
rodič
commit
4cf22cc69c
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      dselect/method.cc

+ 2 - 2
dselect/method.cc

@@ -197,8 +197,8 @@ urqresult falliblesubprocess(const char *exepath, const char *name,
   fprintf(stderr,_("Press <enter> to continue.\n"));
   fprintf(stderr,_("Press <enter> to continue.\n"));
   if (ferror(stderr))
   if (ferror(stderr))
     ohshite(_("write error on standard error"));
     ohshite(_("write error on standard error"));
-  do { c= fgetc(stdin); } while (c != EOF && c != '\n');
-  if (c == EOF)
+  do { c= fgetc(stdin); } while ((c == ERR && errno==EINTR) || (c != '\n'));
+  if (c == ERR)
     ohshite(_("error reading acknowledgement of program failure message"));
     ohshite(_("error reading acknowledgement of program failure message"));
   return urqr_fail;
   return urqr_fail;
 }
 }