cpio: fix regression in prev commit (harmless)
authorDenis Vlasenko <vda.linux@googlemail.com>
Fri, 17 Oct 2008 14:11:04 +0000 (14:11 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Fri, 17 Oct 2008 14:11:04 +0000 (14:11 -0000)
archival/cpio.c

index d39640d24f6cb9dd70d913065ffffda4859c2c6d..b447b27e40d0adfc756d0bbf62b5820d710aa60c 100644 (file)
@@ -341,11 +341,13 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
                argv++;
        }
 
+       /* see get_header_cpio */
+       archive_handle->ah_priv[2] = (void*) ~(ptrdiff_t)0;
        while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
                continue;
 
-       /* see get_header_cpio */
-       printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
+       if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0)
+               printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
 
        return EXIT_SUCCESS;
 }