diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-29 22:08:26 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-29 22:08:26 +0200 |
commit | d4e485cf4a55d0b079d8e2607a98aef7959130a0 (patch) | |
tree | 305ada0c24e1e1a51d10d6d0f02242ced3a9a1a8 | |
parent | ab463c99e64c432f29b077c1d1566b9ed6115b5c (diff) | |
download | busybox-w32-d4e485cf4a55d0b079d8e2607a98aef7959130a0.tar.gz busybox-w32-d4e485cf4a55d0b079d8e2607a98aef7959130a0.tar.bz2 busybox-w32-d4e485cf4a55d0b079d8e2607a98aef7959130a0.zip |
patch
-rw-r--r-- | editors/patch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editors/patch.c b/editors/patch.c index 08f250e8b..507112377 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -25,7 +25,7 @@ static unsigned copy_lines(FILE *src_stream, FILE *dst_stream, unsigned lines_co | |||
25 | { | 25 | { |
26 | while (src_stream && lines_count) { | 26 | while (src_stream && lines_count) { |
27 | char *line; | 27 | char *line; |
28 | line = xmalloc_getline(src_stream); | 28 | line = xmalloc_fgetline(src_stream); |
29 | if (line == NULL) { | 29 | if (line == NULL) { |
30 | break; | 30 | break; |
31 | } | 31 | } |
@@ -142,7 +142,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
142 | /* Extract the filename used before the patch was generated */ | 142 | /* Extract the filename used before the patch was generated */ |
143 | new_filename = extract_filename(patch_line, patch_level, "--- "); | 143 | new_filename = extract_filename(patch_line, patch_level, "--- "); |
144 | // was old_filename above | 144 | // was old_filename above |
145 | patch_line = xmalloc_getline(patch_file); | 145 | patch_line = xmalloc_fgetline(patch_file); |
146 | if (!patch_line) goto quit; | 146 | if (!patch_line) goto quit; |
147 | } while (!new_filename); | 147 | } while (!new_filename); |
148 | free(new_filename); // "source" filename is irrelevant | 148 | free(new_filename); // "source" filename is irrelevant |
@@ -180,7 +180,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
180 | printf("patching file %s\n", new_filename); | 180 | printf("patching file %s\n", new_filename); |
181 | 181 | ||
182 | /* Handle all hunks for this file */ | 182 | /* Handle all hunks for this file */ |
183 | patch_line = xmalloc_getline(patch_file); | 183 | patch_line = xmalloc_fgetline(patch_file); |
184 | while (patch_line) { | 184 | while (patch_line) { |
185 | unsigned count; | 185 | unsigned count; |
186 | unsigned src_beg_line; | 186 | unsigned src_beg_line; |
@@ -221,7 +221,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
221 | 221 | ||
222 | while (1) { | 222 | while (1) { |
223 | free(patch_line); | 223 | free(patch_line); |
224 | patch_line = xmalloc_getline(patch_file); | 224 | patch_line = xmalloc_fgetline(patch_file); |
225 | if (patch_line == NULL) | 225 | if (patch_line == NULL) |
226 | break; /* EOF */ | 226 | break; /* EOF */ |
227 | if (!*patch_line) { | 227 | if (!*patch_line) { |
@@ -239,7 +239,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
239 | if (src_cur_line == src_last_line) | 239 | if (src_cur_line == src_last_line) |
240 | break; | 240 | break; |
241 | if (src_stream) { | 241 | if (src_stream) { |
242 | src_line = xmalloc_getline(src_stream); | 242 | src_line = xmalloc_fgetline(src_stream); |
243 | if (src_line) { | 243 | if (src_line) { |
244 | int diff = strcmp(src_line, patch_line + 1); | 244 | int diff = strcmp(src_line, patch_line + 1); |
245 | src_cur_line++; | 245 | src_cur_line++; |