diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 1397409cc..a0f190fd4 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -1343,8 +1343,10 @@ int read_line_input(const char *prompt, char *command, int maxsize, line_input_t | |||
1343 | int len; | 1343 | int len; |
1344 | parse_and_put_prompt(prompt); | 1344 | parse_and_put_prompt(prompt); |
1345 | fflush(stdout); | 1345 | fflush(stdout); |
1346 | fgets(command, maxsize, stdin); | 1346 | if (fgets(command, maxsize, stdin) == NULL) |
1347 | len = strlen(command); | 1347 | len = -1; /* EOF or error */ |
1348 | else | ||
1349 | len = strlen(command); | ||
1348 | DEINIT_S(); | 1350 | DEINIT_S(); |
1349 | return len; | 1351 | return len; |
1350 | } | 1352 | } |