summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-12 22:43:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-12 22:43:20 +0000
commit2d5ca60bfb66e0ba7340ab9b4696b872f00adf7c (patch)
tree08de18a783dbb518dfbe5832751a214aff7d0a7a /editors
parent372686bde7b4c0abaf01123d8dda1dc6ab9a92e2 (diff)
downloadbusybox-w32-2d5ca60bfb66e0ba7340ab9b4696b872f00adf7c.tar.gz
busybox-w32-2d5ca60bfb66e0ba7340ab9b4696b872f00adf7c.tar.bz2
busybox-w32-2d5ca60bfb66e0ba7340ab9b4696b872f00adf7c.zip
bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
Diffstat (limited to 'editors')
-rw-r--r--editors/patch.c14
-rw-r--r--editors/sed.c4
2 files changed, 9 insertions, 9 deletions
diff --git a/editors/patch.c b/editors/patch.c
index 9336b275a..545e70b50 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -32,7 +32,7 @@ static unsigned int copy_lines(FILE *src_stream, FILE *dest_stream, const unsign
32 32
33 while (src_stream && (i < lines_count)) { 33 while (src_stream && (i < lines_count)) {
34 char *line; 34 char *line;
35 line = bb_get_line_from_file(src_stream); 35 line = xmalloc_fgets(src_stream);
36 if (line == NULL) { 36 if (line == NULL) {
37 break; 37 break;
38 } 38 }
@@ -96,7 +96,7 @@ int patch_main(int argc, char **argv)
96 ret = 0; 96 ret = 0;
97 } 97 }
98 98
99 patch_line = bb_get_line_from_file(patch_file); 99 patch_line = xmalloc_fgets(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,14 +115,14 @@ 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 = bb_get_line_from_file(patch_file); 118 patch_line = xmalloc_fgets(patch_file);
119 } 119 }
120 120
121 /* Extract the filename used before the patch was generated */ 121 /* Extract the filename used before the patch was generated */
122 original_filename = extract_filename(patch_line, patch_level); 122 original_filename = extract_filename(patch_line, patch_level);
123 free(patch_line); 123 free(patch_line);
124 124
125 patch_line = bb_get_line_from_file(patch_file); 125 patch_line = xmalloc_fgets(patch_file);
126 if (strncmp(patch_line, "+++ ", 4) != 0) { 126 if (strncmp(patch_line, "+++ ", 4) != 0) {
127 ret = 2; 127 ret = 2;
128 bb_error_msg("Invalid patch"); 128 bb_error_msg("Invalid patch");
@@ -166,7 +166,7 @@ int patch_main(int argc, char **argv)
166 printf("patching file %s\n", new_filename); 166 printf("patching file %s\n", new_filename);
167 167
168 /* Handle each hunk */ 168 /* Handle each hunk */
169 patch_line = bb_get_line_from_file(patch_file); 169 patch_line = xmalloc_fgets(patch_file);
170 while (patch_line) { 170 while (patch_line) {
171 unsigned int count; 171 unsigned int count;
172 unsigned int src_beg_line; 172 unsigned int src_beg_line;
@@ -197,11 +197,11 @@ int patch_main(int argc, char **argv)
197 } 197 }
198 hunk_offset_start = src_cur_line; 198 hunk_offset_start = src_cur_line;
199 199
200 while ((patch_line = bb_get_line_from_file(patch_file)) != NULL) { 200 while ((patch_line = xmalloc_fgets(patch_file)) != NULL) {
201 if ((*patch_line == '-') || (*patch_line == ' ')) { 201 if ((*patch_line == '-') || (*patch_line == ' ')) {
202 char *src_line = NULL; 202 char *src_line = NULL;
203 if (src_stream) { 203 if (src_stream) {
204 src_line = bb_get_line_from_file(src_stream); 204 src_line = xmalloc_fgets(src_stream);
205 if (!src_line) { 205 if (!src_line) {
206 hunk_error++; 206 hunk_error++;
207 break; 207 break;
diff --git a/editors/sed.c b/editors/sed.c
index 7dba8b456..30f35ce22 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -904,7 +904,7 @@ restart:
904 if (rfile) { 904 if (rfile) {
905 char *line; 905 char *line;
906 906
907 while ((line = bb_get_chomped_line_from_file(rfile)) 907 while ((line = xmalloc_getline(rfile))
908 != NULL) 908 != NULL)
909 append(line); 909 append(line);
910 xprint_and_close_file(rfile); 910 xprint_and_close_file(rfile);
@@ -1099,7 +1099,7 @@ static void add_files_link(llist_t *opt_f)
1099 if (!opt_f) return; 1099 if (!opt_f) return;
1100 add_files_link(opt_f->link); 1100 add_files_link(opt_f->link);
1101 cmdfile = xfopen(opt_f->data, "r"); 1101 cmdfile = xfopen(opt_f->data, "r");
1102 while ((line = bb_get_chomped_line_from_file(cmdfile)) != NULL) { 1102 while ((line = xmalloc_getline(cmdfile)) != NULL) {
1103 add_cmd(line); 1103 add_cmd(line);
1104 free(line); 1104 free(line);
1105 } 1105 }