When we are extracting directory with --unlink option and the directory

already exists don't spew bogus "Cannot unlink" error and exit with
non-zero code.

Reported by:	bde
This commit is contained in:
Maxim Sobolev 2002-07-03 12:44:31 +00:00
parent 6e02167b57
commit b19918bd36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99345

View File

@ -1140,8 +1140,12 @@ extract_archive (void)
else if (typeflag == GNUTYPE_DUMPDIR)
skip_member ();
if (! prepare_to_extract (CURRENT_FILE_NAME))
break;
{
struct stat st;
if (stat (CURRENT_FILE_NAME, &st) != 0 || !S_ISDIR (st.st_mode))
if (! prepare_to_extract (CURRENT_FILE_NAME))
break;
}
mode = ((current_stat.st_mode
| (we_are_root ? 0 : MODE_WXUSR))