patch from Brian Carlson for Debian
[debian/pax] / pax.c
diff --git a/pax.c b/pax.c
index 3c3d2b4719704c8b0f9917a55f419d828d60b08e..5e2ec59084ce98c0322b818b83b1999de61c2418 100644 (file)
--- a/pax.c
+++ b/pax.c
@@ -105,7 +105,7 @@ char        *dirptr;                /* destination dir in a copy */
 char   *ltmfrmt;               /* -v locale time format (if any) */
 char   *argv0;                 /* root of argv[0] */
 sigset_t s_mask;               /* signal mask for cleanup critical sect */
-FILE   *listf = stderr;        /* file pointer to print file list to */
+FILE   *listf; /* file pointer to print file list to */
 char   *tempfile;              /* tempfile to use for mkstemp(3) */
 char   *tempbase;              /* basename of tempfile to use for mkstemp(3) */
 
@@ -235,6 +235,12 @@ main(int argc, char **argv)
        char *tmpdir;
        size_t tdlen;
 
+       /* 
+        * On some systems, stderr is not a constant, so we initialize listf
+        * immediately to emulate the behavior.
+        */
+       listf=stderr;
+
        /*
         * Keep a reference to cwd, so we can always come back home.
         */