Applied patch from David Douthitt to fix build error in df.c when
[oweals/busybox.git] / tar.c
diff --git a/tar.c b/tar.c
index 60744e8db91740256fc37398f8616375165305d6..a9363d5ad65385a4062474abb6cd9d79a6b1651a 100644 (file)
--- a/tar.c
+++ b/tar.c
  */
 
 
-#include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_io_error
-#define bb_need_name_longer_than_foo
-#include "messages.c"
 #include <stdio.h>
 #include <dirent.h>
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include "busybox.h"
+#define BB_DECLARE_EXTERN
+#define bb_need_io_error
+#define bb_need_name_longer_than_foo
+#include "messages.c"
 
 #ifdef BB_FEATURE_TAR_GZIP
 extern int unzip(int in, int out);
@@ -214,7 +214,7 @@ extern int tar_main(int argc, char **argv)
        int opt;
 
        if (argc <= 1)
-               usage(tar_usage);
+               show_usage();
 
        if (argv[1][0] != '-') {
                char *tmp = xmalloc(strlen(argv[1]) + 2);
@@ -274,8 +274,7 @@ extern int tar_main(int argc, char **argv)
                                while (fgets(file, sizeof(file), fileList) != NULL) {
                                        excludeList = xrealloc(excludeList,
                                                        sizeof(char *) * (excludeListSize+2));
-                                       if (file[strlen(file)-1] == '\n')
-                                               file[strlen(file)-1] = '\0';
+                                       chomp(file);
                                        excludeList[excludeListSize] = xstrdup(file);
                                        /* Tack a NULL onto the end of the list */
                                        excludeList[++excludeListSize] = NULL;
@@ -284,7 +283,7 @@ extern int tar_main(int argc, char **argv)
                                break;
 #endif
                                default:
-                                       usage(tar_usage);
+                                       show_usage();
                }
        }