diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/bb_askpass.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index fe2b50677..77c1bcd95 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c | |||
@@ -65,7 +65,9 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | |||
65 | i = 0; | 65 | i = 0; |
66 | while (1) { | 66 | while (1) { |
67 | int r = read(fd, &ret[i], 1); | 67 | int r = read(fd, &ret[i], 1); |
68 | if (r < 0) { | 68 | if ((i == 0 && r == 0) /* EOF (^D) with no password */ |
69 | || r < 0 | ||
70 | ) { | ||
69 | /* read is interrupted by timeout or ^C */ | 71 | /* read is interrupted by timeout or ^C */ |
70 | ret = NULL; | 72 | ret = NULL; |
71 | break; | 73 | break; |