diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-22 22:35:12 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:39 +1000 |
commit | 06f9649550cd02a17ce2ce4ad554dd4a4e7bb768 (patch) | |
tree | 839c6403f09bb93b5a1790cc73e46037dc4334eb | |
parent | 90540ee9b9d1bf6622e0d5d9064ba9e42f9fe130 (diff) | |
download | busybox-w32-06f9649550cd02a17ce2ce4ad554dd4a4e7bb768.tar.gz busybox-w32-06f9649550cd02a17ce2ce4ad554dd4a4e7bb768.tar.bz2 busybox-w32-06f9649550cd02a17ce2ce4ad554dd4a4e7bb768.zip |
editors/patch: cannot open files because of trailing \n
-rw-r--r-- | editors/patch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/patch.c b/editors/patch.c index 3de293f03..33e744214 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -103,7 +103,7 @@ int patch_main(int argc, char **argv) | |||
103 | ret = 0; | 103 | ret = 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | patch_line = xmalloc_fgets(patch_file); | 106 | patch_line = xmalloc_getline(patch_file); |
107 | while (patch_line) { | 107 | while (patch_line) { |
108 | FILE *src_stream; | 108 | FILE *src_stream; |
109 | FILE *dst_stream; | 109 | FILE *dst_stream; |
@@ -122,7 +122,7 @@ int patch_main(int argc, char **argv) | |||
122 | */ | 122 | */ |
123 | while (patch_line && strncmp(patch_line, "--- ", 4) != 0) { | 123 | while (patch_line && strncmp(patch_line, "--- ", 4) != 0) { |
124 | free(patch_line); | 124 | free(patch_line); |
125 | patch_line = xmalloc_fgets(patch_file); | 125 | patch_line = xmalloc_getline(patch_file); |
126 | } | 126 | } |
127 | /* FIXME: patch_line NULL check?? */ | 127 | /* FIXME: patch_line NULL check?? */ |
128 | 128 | ||
@@ -134,7 +134,7 @@ int patch_main(int argc, char **argv) | |||
134 | #endif | 134 | #endif |
135 | free(patch_line); | 135 | free(patch_line); |
136 | 136 | ||
137 | patch_line = xmalloc_fgets(patch_file); | 137 | patch_line = xmalloc_getline(patch_file); |
138 | /* FIXME: NULL check?? */ | 138 | /* FIXME: NULL check?? */ |
139 | if (strncmp(patch_line, "+++ ", 4) != 0) { | 139 | if (strncmp(patch_line, "+++ ", 4) != 0) { |
140 | ret = 2; | 140 | ret = 2; |