Ignore some generated files
[oweals/busybox.git] / tar.c
diff --git a/tar.c b/tar.c
index 15d050c5a1b72759f7577097c9ea41cab95f0803..716f4ac3071c5fb8cf349212c3e59df39c050de6 100644 (file)
--- a/tar.c
+++ b/tar.c
 #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"
 
 /* Tar file constants  */
 #ifndef MAJOR
@@ -133,7 +129,7 @@ struct TarInfo
 typedef struct TarInfo TarInfo;
 
 /* Local procedures to restore files from a tar file.  */
-extern int readTarFile(int tarFd, int extractFlag, int listFlag, 
+static int readTarFile(int tarFd, int extractFlag, int listFlag, 
                int tostdoutFlag, int verboseFlag, char** extractList,
                char** excludeList);
 
@@ -571,7 +567,7 @@ static int extract_file(char **extract_files, const char *file)
  * Read a tar file and extract or list the specified files within it.
  * If the list is empty than all files are extracted or listed.
  */
-extern int readTarFile(int tarFd, int extractFlag, int listFlag, 
+static int readTarFile(int tarFd, int extractFlag, int listFlag, 
                int tostdoutFlag, int verboseFlag, char** extractList,
                char** excludeList)
 {
@@ -710,7 +706,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
                        case REGTYPE0:
                                /* If the name ends in a '/' then assume it is
                                 * supposed to be a directory, and fall through */
-                               if (header.name[strlen(header.name)-1] != '/') {
+                               if (last_char_is(header.name,'/')) {
                                        if (tarExtractRegularFile(&header, extractFlag, tostdoutFlag)==FALSE)
                                                errorFlag=TRUE;
                                        break;