summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-15 16:07:17 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-15 16:07:17 +0000
commitd0650a05fe2c0c137c168267e07071f674fa64bd (patch)
treea47efd6206f8c348b564e46ff6d0cc3fadf3d672 /win32/win32.c
parentc4bbdec38b7d8acc8d248c7cddb7da8c7ed09205 (diff)
downloadperl-d0650a05fe2c0c137c168267e07071f674fa64bd.tar.gz
propagate st_mode bits to group/other for Borland build
(from Vadim Konovalov <vkonovalov@lucent.com>) p4raw-id: //depot/perl@5097
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 71097ea1ae..b17275928a 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1132,6 +1132,7 @@ win32_stat(const char *path, struct stat *sbuf)
if (S_ISDIR(sbuf->st_mode))
sbuf->st_mode |= S_IWRITE | S_IEXEC;
else if (S_ISREG(sbuf->st_mode)) {
+ int perms;
if (l >= 4 && path[l-4] == '.') {
const char *e = path + l - 3;
if (strnicmp(e,"exe",3)
@@ -1144,6 +1145,9 @@ win32_stat(const char *path, struct stat *sbuf)
}
else
sbuf->st_mode &= ~S_IEXEC;
+ /* Propagate permissions to _group_ and _others_ */
+ perms = sbuf->st_mode & (S_IREAD|S_IWRITE|S_IEXEC);
+ sbuf->st_mode |= (perms>>3) | (perms>>6);
}
#endif
}