summaryrefslogtreecommitdiff
path: root/dselect
diff options
context:
space:
mode:
authorWichert Akkerman <wakkerma@debian.org>2002-02-06 11:30:43 +0000
committerWichert Akkerman <wakkerma@debian.org>2002-02-06 11:30:43 +0000
commit3c7ebb33f7607e45e82d82d33dab2ec92b5136a3 (patch)
tree3cecc2339558e4a91b027104fe37906bed405a0d /dselect
parent3a3edc797b607d6f343f9be2f80f671b9de50c2f (diff)
downloaddpkg-3c7ebb33f7607e45e82d82d33dab2ec92b5136a3.tar.gz
check fgetc() for EOF return so we don't spin if we can't read input
Diffstat (limited to 'dselect')
-rw-r--r--dselect/method.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/dselect/method.cc b/dselect/method.cc
index e3cfecb4a..125351889 100644
--- a/dselect/method.cc
+++ b/dselect/method.cc
@@ -3,7 +3,7 @@
* method.cc - access method handling
*
* Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
- * Copyright (C) 2001 Wichert Akkerman <wakkerma@debian.org>
+ * Copyright (C) 2001,2002 Wichert Akkerman <wakkerma@debian.org>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -197,8 +197,8 @@ urqresult falliblesubprocess(const char *exepath, const char *name,
fprintf(stderr,_("Press <enter> to continue.\n"));
if (ferror(stderr))
ohshite(_("write error on standard error"));
- do { c= fgetc(stdin); } while ((c == ERR && errno==EINTR) || (c != '\n'));
- if (c == ERR)
+ do { c= fgetc(stdin); } while ((c == ERR && errno==EINTR) || ((c != '\n') && c != EOF));
+ if ((c == ERR) || (c == EOF))
ohshite(_("error reading acknowledgement of program failure message"));
return urqr_fail;
}