Patch from Stefan Soucek <ssoucek@coactive.com> to
[oweals/busybox.git] / libbb / fgets_str.c
index 33d8d00ccc3c2d37ab79e55f373e05e16a7e6011..7d41d72f1d63c4ada9e670f720b43167fb461dee 100644 (file)
@@ -55,7 +55,7 @@ char *fgets_str(FILE *file, const char *terminating_string)
                        break;
                }
        }
-       if (idx == 0) {
+       if (idx == 0 || linebuf[0] == '\n') {
                return NULL;
        }
        linebuf[idx] = '\0';