} while (0)
-/*static void print_only(const char *path, size_t dirlen, const char *entry)*/
+#if ENABLE_FEATURE_DIFF_DIR
static void print_only(const char *path, const char *entry)
{
printf("Only in %s: %s\n", path, entry);
}
+#endif
-/*static void print_status(int val, char *path1, char *path2, char *entry)*/
static void print_status(int val, char *_path1, char *_path2)
{
/*const char *const _entry = entry ? entry : "";*/
member = (int *) nfile[1];
equiv(sfile[0], slen[0], sfile[1], slen[1], member);
+//TODO: xrealloc_vector?
member = xrealloc(member, (slen[1] + 2) * sizeof(int));
class = (int *) nfile[0];
#if ENABLE_FEATURE_DIFF_DIR
/* This function adds a filename to dl, the directory listing. */
-static int add_to_dirlist(const char *filename,
- struct stat *sb ATTRIBUTE_UNUSED,
+static int FAST_FUNC add_to_dirlist(const char *filename,
+ struct stat *sb UNUSED_PARAM,
void *userdata,
- int depth ATTRIBUTE_UNUSED)
+ int depth UNUSED_PARAM)
{
- /* +2: with space for eventual trailing NULL */
- dl = xrealloc(dl, (dl_count+2) * sizeof(dl[0]));
+ dl = xrealloc_vector(dl, 5, dl_count);
dl[dl_count] = xstrdup(filename + (int)(ptrdiff_t)userdata);
dl_count++;
return TRUE;
recursive_action(path, ACTION_RECURSE|ACTION_FOLLOWLINKS,
add_to_dirlist, /* file_action */
NULL, /* dir_action */
- (void*)(strlen(path) + 1),
+ (void*)(ptrdiff_t)(strlen(path) + 1),
0);
} else {
DIR *dp;
int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int diff_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int diff_main(int argc UNUSED_PARAM, char **argv)
{
int gotstdin = 0;
char *f1, *f2;
while (L_arg) {
if (label1 && label2)
bb_show_usage();
- if (!label1)
- label1 = L_arg->data;
- else { /* then label2 is NULL */
+ if (label1) /* then label2 is NULL */
label2 = label1;
- label1 = L_arg->data;
- }
- /* we leak L_arg here... */
- L_arg = L_arg->link;
+ label1 = llist_pop(&L_arg);
}
/*