aboutsummaryrefslogtreecommitdiff
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-2d5ca60bfb66e0ba7340ab9b4696b872f00adf7c.tar.gz
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
while (src_stream && (i < lines_count)) {
char *line;
- line = bb_get_line_from_file(src_stream);
+ line = xmalloc_fgets(src_stream);
if (line == NULL) {
break;
}
@@ -96,7 +96,7 @@ int patch_main(int argc, char **argv)
ret = 0;
}
- patch_line = bb_get_line_from_file(patch_file);
+ patch_line = xmalloc_fgets(patch_file);
while (patch_line) {
FILE *src_stream;
FILE *dst_stream;
@@ -115,14 +115,14 @@ int patch_main(int argc, char **argv)
*/
while (patch_line && strncmp(patch_line, "--- ", 4) != 0) {
free(patch_line);
- patch_line = bb_get_line_from_file(patch_file);
+ patch_line = xmalloc_fgets(patch_file);
}
/* Extract the filename used before the patch was generated */
original_filename = extract_filename(patch_line, patch_level);
free(patch_line);
- patch_line = bb_get_line_from_file(patch_file);
+ patch_line = xmalloc_fgets(patch_file);
if (strncmp(patch_line, "+++ ", 4) != 0) {
ret = 2;
bb_error_msg("Invalid patch");
@@ -166,7 +166,7 @@ int patch_main(int argc, char **argv)
printf("patching file %s\n", new_filename);
/* Handle each hunk */
- patch_line = bb_get_line_from_file(patch_file);
+ patch_line = xmalloc_fgets(patch_file);
while (patch_line) {
unsigned int count;
unsigned int src_beg_line;
@@ -197,11 +197,11 @@ int patch_main(int argc, char **argv)
}
hunk_offset_start = src_cur_line;
- while ((patch_line = bb_get_line_from_file(patch_file)) != NULL) {
+ while ((patch_line = xmalloc_fgets(patch_file)) != NULL) {
if ((*patch_line == '-') || (*patch_line == ' ')) {
char *src_line = NULL;
if (src_stream) {
- src_line = bb_get_line_from_file(src_stream);
+ src_line = xmalloc_fgets(src_stream);
if (!src_line) {
hunk_error++;
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:
if (rfile) {
char *line;
- while ((line = bb_get_chomped_line_from_file(rfile))
+ while ((line = xmalloc_getline(rfile))
!= NULL)
append(line);
xprint_and_close_file(rfile);
@@ -1099,7 +1099,7 @@ static void add_files_link(llist_t *opt_f)
if (!opt_f) return;
add_files_link(opt_f->link);
cmdfile = xfopen(opt_f->data, "r");
- while ((line = bb_get_chomped_line_from_file(cmdfile)) != NULL) {
+ while ((line = xmalloc_getline(cmdfile)) != NULL) {
add_cmd(line);
free(line);
}