aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-01 23:30:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-01 23:30:54 +0000
commitfc77eb54e791c7d636c20993ec81396052af84f0 (patch)
tree6525bd68fcdce16266dec77a8628619cf4eadbb5
parenta1b16f4d5c0dd119f85f13c8cb1399a701a3e815 (diff)
downloadbusybox-w32-fc77eb54e791c7d636c20993ec81396052af84f0.tar.gz
busybox-w32-fc77eb54e791c7d636c20993ec81396052af84f0.tar.bz2
busybox-w32-fc77eb54e791c7d636c20993ec81396052af84f0.zip
patch: fix bad line ending handling ("Nguyen Thai Ngoc Duy" <pclouds@gmail.com>)
-rw-r--r--editors/patch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/patch.c b/editors/patch.c
index f65bbf4f9..5f7f7d028 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -96,7 +96,7 @@ int patch_main(int argc, char **argv)
96 ret = 0; 96 ret = 0;
97 } 97 }
98 98
99 patch_line = xmalloc_fgets(patch_file); 99 patch_line = xmalloc_getline(patch_file);
100 while (patch_line) { 100 while (patch_line) {
101 FILE *src_stream; 101 FILE *src_stream;
102 FILE *dst_stream; 102 FILE *dst_stream;
@@ -115,7 +115,7 @@ int patch_main(int argc, char **argv)
115 */ 115 */
116 while (patch_line && strncmp(patch_line, "--- ", 4) != 0) { 116 while (patch_line && strncmp(patch_line, "--- ", 4) != 0) {
117 free(patch_line); 117 free(patch_line);
118 patch_line = xmalloc_fgets(patch_file); 118 patch_line = xmalloc_getline(patch_file);
119 } 119 }
120 /* FIXME: patch_line NULL check?? */ 120 /* FIXME: patch_line NULL check?? */
121 121
@@ -123,7 +123,7 @@ int patch_main(int argc, char **argv)
123 original_filename = extract_filename(patch_line, patch_level); 123 original_filename = extract_filename(patch_line, patch_level);
124 free(patch_line); 124 free(patch_line);
125 125
126 patch_line = xmalloc_fgets(patch_file); 126 patch_line = xmalloc_getline(patch_file);
127 /* FIXME: NULL check?? */ 127 /* FIXME: NULL check?? */
128 if (strncmp(patch_line, "+++ ", 4) != 0) { 128 if (strncmp(patch_line, "+++ ", 4) != 0) {
129 ret = 2; 129 ret = 2;