summaryrefslogtreecommitdiffhomepage
path: root/libbb
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-18 03:20:41 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-18 03:20:41 +0000
commit1bf25f030777a83ed498914ad65ba3d44b8b3fdc (patch)
treea1b1a780ea8136c06301d3917aad565d035aba85 /libbb
parent4bef7b41861f02874bce4ac6ab0c8c2484d41d07 (diff)
Patch from Stefan Soucek <ssoucek@coactive.com> to
ignore extra empty lines in fgets_str
Diffstat (limited to 'libbb')
-rw-r--r--libbb/fgets_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index 33d8d00cc..7d41d72f1 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -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';