Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
diff --git a/editors/patch.c b/editors/patch.c
index 337d1bb..a710d82 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -67,7 +67,7 @@
filename_start_ptr = temp + 1;
}
- return(bb_xstrdup(filename_start_ptr));
+ return(xstrdup(filename_start_ptr));
}
static int file_doesnt_exist(const char *filename)
@@ -89,7 +89,7 @@
if (ret & 1)
patch_level = bb_xgetlarg(p, 10, -1, USHRT_MAX);
if (ret & 2) {
- patch_file = bb_xfopen(i, "r");
+ patch_file = xfopen(i, "r");
} else {
patch_file = stdin;
}
@@ -140,7 +140,7 @@
bb_make_directory(new_filename, -1, FILEUTILS_RECUR);
*line_ptr = '/';
}
- dst_stream = bb_xfopen(new_filename, "w+");
+ dst_stream = xfopen(new_filename, "w+");
backup_filename = NULL;
} else {
backup_filename = xmalloc(strlen(new_filename) + 6);
@@ -150,16 +150,16 @@
bb_perror_msg_and_die("Couldnt create file %s",
backup_filename);
}
- dst_stream = bb_xfopen(new_filename, "w");
+ dst_stream = xfopen(new_filename, "w");
}
if ((backup_filename == NULL) || file_doesnt_exist(original_filename)) {
src_stream = NULL;
} else {
if (strcmp(original_filename, new_filename) == 0) {
- src_stream = bb_xfopen(backup_filename, "r");
+ src_stream = xfopen(backup_filename, "r");
} else {
- src_stream = bb_xfopen(original_filename, "r");
+ src_stream = xfopen(original_filename, "r");
}
}