summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-03-26 12:45:28 +0000
committerNicholas Clark <nick@ccl4.org>2008-03-26 12:45:28 +0000
commitffb25c022b05df9db5c6187778158eaf2a3ce49c (patch)
tree2d8b20328b04a8522eda0499fe24fa06a1b6b905 /win32
parentfd8bdd0a3efe7607cfc1b398c7ed55d454c5e211 (diff)
downloadperl-ffb25c022b05df9db5c6187778158eaf2a3ce49c.tar.gz
Integrate:
[ 33332] Subject: [PATCH] consting for .c files in tests From: "Robin Barker" <Robin.Barker@npl.co.uk> Date: Mon, 18 Feb 2008 13:43:56 -0000 Message-ID: <46A0F33545E63740BC7563DE59CA9C6D093A3F@exchsvr2.npl.ad.local> [ 33386] Subject: Fwd: CPAN Upload: Y/YV/YVES/ExtUtils-Install-1.45.tar.gz From: demerphq <demerphq@gmail.com> Date: Wed, 27 Feb 2008 14:06:29 +0100 Message-ID: <9b18b3110802270506j6194cb4idefa42765d634c79@mail.gmail.com> Upgrade to ExtUtils-Install-1.45 to fix [cpan #32813] [ 33404] Synchronize blead with changes from ExtUtils::Install 1.46 Apply patches from Michael Schwern (rt #33688, rt #31429, rt #31248) and from Slaven Rezic (rt #33290). Also implemented the suggestion from Schwern about not dieing when failing to remove a shadow file that is later on in INC than the installed version. (rt #2928) [ 33410] Update ExtUtils::Install to release 1.47 [ 33460] Upgrade to ExtUtils-Install-1.50 [ 33566] Subject: RE: [PATCH revised] Fix ExtUtils::Install under Cygwin From: "Steve Hay" <SteveHay@planit.com> Message-ID: <1B32FF956ABF414C9BCE5E487A1497E70176BD61@ukmail02.planit.group> Date: Mon, 17 Mar 2008 14:36:54 -0000 "OK, so how about the attached. This fixes up -w for all compilers so that it is symmetrical with chmod(), and adds a note to perltodo on fixing POSIX::access() and chdir()." The whole long thread started here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-03/msg00056.html [ 33567] Patches for VMS by Craig Berry from http://rt.cpan.org/Public/Bug/Display.html?id=34095 (1.50 has 3 failures on VMS) p4raw-link: @33567 on //depot/perl: 553b5000d7907cb0cb8f4658c1d6a2aac379415b p4raw-link: @33566 on //depot/perl: 038ae9a45711aea142f721498a4a61353b40c4e4 p4raw-link: @33460 on //depot/perl: 3f6d40bd7fe955329c1f574485922604c74d8097 p4raw-link: @33410 on //depot/perl: 546acaf953817e0057123820b511dae1b4e7bafc p4raw-link: @33404 on //depot/perl: f6d658ccb3241bf660c1870c57e49db3f23e7805 p4raw-link: @33386 on //depot/perl: 54683d5edb85bfe9b7a4df00baf9416e1a7ecf2f p4raw-link: @33332 on //depot/perl: 473d7a83d65393ce327ccad2c8d257d8dbf6c6ae p4raw-id: //depot/maint-5.10/perl@33572 p4raw-branched: from //depot/perl@33549 'branch in' lib/ExtUtils/t/can_write_dir.t (@33404..) lib/ExtUtils/t/Installapi2.t (@33460..) p4raw-integrated: from //depot/perl@33549 'copy in' lib/ExtUtils/t/Install.t (@33404..) 'merge in' pod/perltodo.pod (@33462..) pod/perlport.pod (@33485..) win32/win32.c (@33506..) p4raw-integrated: from //depot/perl@33404 'edit in' MANIFEST (@33394..) 'ignore' lib/ExtUtils/Install.pm (@33386..) p4raw-integrated: from //depot/perl@33332 'merge in' lib/ExtUtils/t/Embed.t (@30840..)
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index d459c94c09..58ea2207bf 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1500,9 +1500,22 @@ win32_stat(const char *path, Stat_t *sbuf)
errno = ENOTDIR;
return -1;
}
+ if (S_ISDIR(sbuf->st_mode)) {
+ /* Ensure the "write" bit is switched off in the mode for
+ * directories with the read-only attribute set. Borland (at least)
+ * switches it on for directories, which is technically correct
+ * (directories are indeed always writable unless denied by DACLs),
+ * but we want stat() and -w to reflect the state of the read-only
+ * attribute for symmetry with chmod(). */
+ DWORD r = GetFileAttributesA(path);
+ if (r != 0xffffffff && (r & FILE_ATTRIBUTE_READONLY)) {
+ sbuf->st_mode &= ~S_IWRITE;
+ }
+ }
#ifdef __BORLANDC__
- if (S_ISDIR(sbuf->st_mode))
- sbuf->st_mode |= S_IWRITE | S_IEXEC;
+ if (S_ISDIR(sbuf->st_mode)) {
+ sbuf->st_mode |= S_IEXEC;
+ }
else if (S_ISREG(sbuf->st_mode)) {
int perms;
if (l >= 4 && path[l-4] == '.') {