1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00
freebsd-ports/archivers/torrentzip/files/patch-src-trrntzip.c
Mathieu Arnold 9fa9eb9ac7 Cleanup patches, a* categories.
Rename them to follow the make makepatch naming, and regenerate them.

With hat:	portmgr
Sponsored by:	Absolight
2016-07-26 16:51:15 +00:00

33 lines
1.2 KiB
C

--- src/trrntzip.c.orig 2005-05-02 13:38:40 UTC
+++ src/trrntzip.c
@@ -716,7 +716,7 @@ RecursiveMigrate (const char *pszPath, W
if (dirp)
{
- // First set all the files to read-only. This is so we can skip
+ // First set the sticky bit on all files. This is so we can skip
// our new zipfiles if they are returned by readdir() a second time.
while (direntp = readdir (dirp))
{
@@ -732,7 +732,7 @@ RecursiveMigrate (const char *pszPath, W
if (strstr (szTmpBuf, ".zip\0"))
{
- chmod (direntp->d_name, S_IRUSR);
+ chmod (direntp->d_name, istat.st_mode | S_ISTXT);
}
}
// Zip file is actually a dir
@@ -780,9 +780,9 @@ RecursiveMigrate (const char *pszPath, W
sprintf (szTmpBuf, "%s", direntp->d_name);
strlwr (szTmpBuf);
- if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR))
+ if (strstr (szTmpBuf, ".zip\0") && (istat.st_mode & S_ISTXT))
{
- chmod (direntp->d_name, S_IWUSR);
+ chmod (direntp->d_name, istat.st_mode & ~S_ISTXT);
mig.cEncounteredZips++;
if (!mig.fProcessLog)