Don't unlink files if we are extracting to stdout.

This commit is contained in:
Matt Kraai 2000-09-01 02:50:48 +00:00
parent e99674a70f
commit f446297afd
2 changed files with 6 additions and 6 deletions

View File

@ -600,9 +600,9 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
printf("\n"); printf("\n");
} }
/* Remove any clutter lying in our way */ /* Remove files if we would overwrite them */
if (extractFlag == TRUE) /* .. but only if we are extracting (as */ if (extractFlag == TRUE && tostdOut == FALSE)
unlink( header.name); /* opposed to listing) (rob@sysgo.de) */ unlink(header.name);
/* If we got here, we can be certain we have a legitimate /* If we got here, we can be certain we have a legitimate
* header to work with. So work with it. */ * header to work with. So work with it. */

6
tar.c
View File

@ -600,9 +600,9 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
printf("\n"); printf("\n");
} }
/* Remove any clutter lying in our way */ /* Remove files if we would overwrite them */
if (extractFlag == TRUE) /* .. but only if we are extracting (as */ if (extractFlag == TRUE && tostdOut == FALSE)
unlink( header.name); /* opposed to listing) (rob@sysgo.de) */ unlink(header.name);
/* If we got here, we can be certain we have a legitimate /* If we got here, we can be certain we have a legitimate
* header to work with. So work with it. */ * header to work with. So work with it. */