summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-10-11 13:19:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-10-11 13:19:54 (GMT)
commit0d8495931b3744280c05530401801c86da4c0a3a (patch)
tree9494539c9c9fdff546f7b6e6c825cdff99f9a96e /win/tclWinFile.c
parentf6d4479e1365159a9fb5b5af0e32063bde30f8ed (diff)
downloadtcl-0d8495931b3744280c05530401801c86da4c0a3a.zip
tcl-0d8495931b3744280c05530401801c86da4c0a3a.tar.gz
tcl-0d8495931b3744280c05530401801c86da4c0a3a.tar.bz2
[Bug 2935503] Incorrect mode field returned by file stat command
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 316a827..c98c42c 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1074,7 +1074,7 @@ static int WinIsReserved(
* volume, because for NTFS root volumes, the getFileAttributesProc
* returns a 'hidden' attribute when it should not.
*
- * We never make any calss to a 'get attributes' routine here,
+ * We never make any calls to a 'get attributes' routine here,
* since we have arranged things so that our caller already knows
* such information.
*
@@ -2023,8 +2023,8 @@ NativeStatMode(DWORD attr, int checkLinks, int isExec)
* other positions.
*/
- mode |= (mode & 0x0700) >> 3;
- mode |= (mode & 0x0700) >> 6;
+ mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 3;
+ mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 6;
return (unsigned short)mode;
}