diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-04-16 20:15:14 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-04-16 20:15:14 +0200 |
commit | 0288b27ad870adc437c370c262b7b41990ae0118 (patch) | |
tree | faa0c0dd84073b77b233d933c8cd39aa1d60ccc3 /libbb/get_line_from_file.c | |
parent | 89b3cbaa97d715ac27e9558ea73a1221925f589b (diff) | |
download | busybox-w32-0288b27ad870adc437c370c262b7b41990ae0118.tar.gz busybox-w32-0288b27ad870adc437c370c262b7b41990ae0118.tar.bz2 busybox-w32-0288b27ad870adc437c370c262b7b41990ae0118.zip |
small fixes atop syslog config patch
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/get_line_from_file.c')
-rw-r--r-- | libbb/get_line_from_file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c index a0ed9193f..9be10687b 100644 --- a/libbb/get_line_from_file.c +++ b/libbb/get_line_from_file.c | |||
@@ -44,8 +44,12 @@ char* FAST_FUNC bb_get_chunk_with_continuation(FILE *file, int *end, int *lineno | |||
44 | idx -= 2; | 44 | idx -= 2; |
45 | } | 45 | } |
46 | } | 46 | } |
47 | if (end) | 47 | if (end) { |
48 | *end = idx; | 48 | *end = idx; |
49 | /* handle corner case when the file is not ended with '\n' */ | ||
50 | if (ch == EOF && lineno != NULL) | ||
51 | (*lineno)++; | ||
52 | } | ||
49 | if (linebuf) { | 53 | if (linebuf) { |
50 | // huh, does fgets discard prior data on error like this? | 54 | // huh, does fgets discard prior data on error like this? |
51 | // I don't think so.... | 55 | // I don't think so.... |