Fix the pwd and group functions. The bb_ stuff was a leftover from
[oweals/busybox.git] / tar.c
diff --git a/tar.c b/tar.c
index 2699550ec19fdf44919fc8f58629af9e83cf1a90..3082914550a32672d10dcd8ed4270092be31219e 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -6,7 +6,7 @@
  * ground up.  It still has remnents of the old code lying about, but it is
  * very different now (i.e. cleaner, less global variables, etc)
  *
- * Copyright (C) 2000 by Lineo, inc.
+ * Copyright (C) 1999,2000,2001 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * Based in part in the tar implementation in sash
@@ -52,6 +52,9 @@
 #include <sys/sysmacros.h>
 #include <getopt.h>
 #include <fnmatch.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #ifdef BB_FEATURE_TAR_GZIP
 extern int unzip(int in, int out);
@@ -64,7 +67,7 @@ extern int gunzip_init();
 #define MINOR(dev) ((dev)&0xff)
 #endif
 
-#define NAME_SIZE      100
+enum { NAME_SIZE = 100 }; /* because gcc won't let me use 'static const int' */
 
 /* POSIX tar Header Block, from POSIX 1003.1-1990  */
 struct TarHeader
@@ -94,9 +97,9 @@ typedef struct TarHeader TarHeader;
 /* A few useful constants */
 #define TAR_MAGIC          "ustar"        /* ustar and a null */
 #define TAR_VERSION        "  "           /* Be compatable with GNU tar format */
-#define TAR_MAGIC_LEN       6
-#define TAR_VERSION_LEN     2
-#define TAR_BLOCK_SIZE      512
+static const int TAR_MAGIC_LEN = 6;
+static const int TAR_VERSION_LEN = 2;
+static const int TAR_BLOCK_SIZE = 512;
 
 /* A nice enum with all the possible tar file content types */
 enum TarFileType