aboutsummaryrefslogtreecommitdiff
path: root/libbb/get_line_from_file.c
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-16 05:25:43 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-16 05:25:43 +0000
commitc55dc215e1e5b45975d96f8f4ae25d8320fa1380 (patch)
treede00e748021d3078ea21bb90017ded81129cb4bd /libbb/get_line_from_file.c
parent06cbc471880cb5ea8f3293eaaa0f0a4b0b49580f (diff)
downloadbusybox-w32-c55dc215e1e5b45975d96f8f4ae25d8320fa1380.tar.gz
busybox-w32-c55dc215e1e5b45975d96f8f4ae25d8320fa1380.tar.bz2
busybox-w32-c55dc215e1e5b45975d96f8f4ae25d8320fa1380.zip
Configuration option to define wether to follows GNU sed's behaviour
or the posix standard. Put the cleanup code back the way it was. git-svn-id: svn://busybox.net/trunk/busybox@7535 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb/get_line_from_file.c')
-rw-r--r--libbb/get_line_from_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index 3b6e1e778..9a831f184 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -40,7 +40,7 @@ static char *private_get_line_from_file(FILE *file, int c)
40 40
41 while ((ch = getc(file)) != EOF) { 41 while ((ch = getc(file)) != EOF) {
42 /* grow the line buffer as necessary */ 42 /* grow the line buffer as necessary */
43 if (idx > linebufsz-2) { 43 if (idx > linebufsz - 2) {
44 linebuf = xrealloc(linebuf, linebufsz += GROWBY); 44 linebuf = xrealloc(linebuf, linebufsz += GROWBY);
45 } 45 }
46 linebuf[idx++] = (char)ch; 46 linebuf[idx++] = (char)ch;
@@ -51,7 +51,6 @@ static char *private_get_line_from_file(FILE *file, int c)
51 break; 51 break;
52 } 52 }
53 } 53 }
54
55 if (linebuf) { 54 if (linebuf) {
56 if (ferror(file)) { 55 if (ferror(file)) {
57 free(linebuf); 56 free(linebuf);