summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-10-08 20:16:41 (GMT)
committerhobbs <hobbs>2004-10-08 20:16:41 (GMT)
commita0450acd9622a064562fefe006306d0775937c30 (patch)
treec979e620c04132cdde3edcb7e2c9898b0a184b55
parentf7bc88de0e53b6ba8710bd7b8c269289a2d16863 (diff)
downloadtcl-a0450acd9622a064562fefe006306d0775937c30.zip
tcl-a0450acd9622a064562fefe006306d0775937c30.tar.gz
tcl-a0450acd9622a064562fefe006306d0775937c30.tar.bz2
* win/tclWinFile.c (NativeIsExec): correct result of 'file
executable' to not be case sensitive. [Bug 954263]
-rw-r--r--ChangeLog5
-rw-r--r--win/tclWinFile.c23
2 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ad735f0..5f74f81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tclWinFile.c (NativeIsExec): correct result of 'file
+ executable' to not be case sensitive. [Bug 954263]
+
2004-10-05 Don Porter <dgp@users.sourceforge.net>
* generic/tclNamesp.c (Tcl_PopCallFrame): Removed Bug 1038021
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 574577e..1ad7da8 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.9 2004/07/02 16:52:20 vincentdarley Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.10 2004/10/08 20:16:42 hobbs Exp $
*/
//#define _WIN32_WINNT 0x0500
@@ -1334,28 +1334,31 @@ NativeIsExec(nativePath)
if (tclWinProcs->useWide) {
CONST WCHAR *path;
int len;
-
+
path = (CONST WCHAR*)nativePath;
len = wcslen(path);
-
+
if (len < 5) {
return 0;
}
-
+
if (path[len-4] != L'.') {
return 0;
}
-
- if ((memcmp((char*)(path+len-3),L"exe",3*sizeof(WCHAR)) == 0)
- || (memcmp((char*)(path+len-3),L"com",3*sizeof(WCHAR)) == 0)
- || (memcmp((char*)(path+len-3),L"bat",3*sizeof(WCHAR)) == 0)) {
+
+ /*
+ * Use wide-char case-insensitive comparison
+ */
+ if ((_wcsicmp(path+len-3,L"exe") == 0)
+ || (_wcsicmp(path+len-3,L"com") == 0)
+ || (_wcsicmp(path+len-3,L"bat") == 0)) {
return 1;
}
} else {
CONST char *p;
-
+
/* We are only looking for pure ascii */
-
+
p = strrchr((CONST char*)nativePath, '.');
if (p != NULL) {
p++;