aboutsummaryrefslogtreecommitdiff
path: root/editors/patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/patch.c')
-rw-r--r--editors/patch.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/patch.c b/editors/patch.c
index 337d1bbad..a710d8224 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -67,7 +67,7 @@ static char *extract_filename(char *line, int patch_level)
67 filename_start_ptr = temp + 1; 67 filename_start_ptr = temp + 1;
68 } 68 }
69 69
70 return(bb_xstrdup(filename_start_ptr)); 70 return(xstrdup(filename_start_ptr));
71} 71}
72 72
73static int file_doesnt_exist(const char *filename) 73static int file_doesnt_exist(const char *filename)
@@ -89,7 +89,7 @@ int patch_main(int argc, char **argv)
89 if (ret & 1) 89 if (ret & 1)
90 patch_level = bb_xgetlarg(p, 10, -1, USHRT_MAX); 90 patch_level = bb_xgetlarg(p, 10, -1, USHRT_MAX);
91 if (ret & 2) { 91 if (ret & 2) {
92 patch_file = bb_xfopen(i, "r"); 92 patch_file = xfopen(i, "r");
93 } else { 93 } else {
94 patch_file = stdin; 94 patch_file = stdin;
95 } 95 }
@@ -140,7 +140,7 @@ int patch_main(int argc, char **argv)
140 bb_make_directory(new_filename, -1, FILEUTILS_RECUR); 140 bb_make_directory(new_filename, -1, FILEUTILS_RECUR);
141 *line_ptr = '/'; 141 *line_ptr = '/';
142 } 142 }
143 dst_stream = bb_xfopen(new_filename, "w+"); 143 dst_stream = xfopen(new_filename, "w+");
144 backup_filename = NULL; 144 backup_filename = NULL;
145 } else { 145 } else {
146 backup_filename = xmalloc(strlen(new_filename) + 6); 146 backup_filename = xmalloc(strlen(new_filename) + 6);
@@ -150,16 +150,16 @@ int patch_main(int argc, char **argv)
150 bb_perror_msg_and_die("Couldnt create file %s", 150 bb_perror_msg_and_die("Couldnt create file %s",
151 backup_filename); 151 backup_filename);
152 } 152 }
153 dst_stream = bb_xfopen(new_filename, "w"); 153 dst_stream = xfopen(new_filename, "w");
154 } 154 }
155 155
156 if ((backup_filename == NULL) || file_doesnt_exist(original_filename)) { 156 if ((backup_filename == NULL) || file_doesnt_exist(original_filename)) {
157 src_stream = NULL; 157 src_stream = NULL;
158 } else { 158 } else {
159 if (strcmp(original_filename, new_filename) == 0) { 159 if (strcmp(original_filename, new_filename) == 0) {
160 src_stream = bb_xfopen(backup_filename, "r"); 160 src_stream = xfopen(backup_filename, "r");
161 } else { 161 } else {
162 src_stream = bb_xfopen(original_filename, "r"); 162 src_stream = xfopen(original_filename, "r");
163 } 163 }
164 } 164 }
165 165