summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorashok <ashok>2016-07-09 14:18:22 (GMT)
committerashok <ashok>2016-07-09 14:18:22 (GMT)
commitcc8c25008d6a30ceb0b4a6946e4a3d45431637c6 (patch)
tree363d4cf0de55087e7ce2d4a73b1c80c68207922e /win/tclWinPipe.c
parent11dc688b81fc6d55eb42fd23e063a5310569d71d (diff)
downloadtcl-cc8c25008d6a30ceb0b4a6946e4a3d45431637c6.zip
tcl-cc8c25008d6a30ceb0b4a6946e4a3d45431637c6.tar.gz
tcl-cc8c25008d6a30ceb0b4a6946e4a3d45431637c6.tar.bz2
Bugfix [9ece99d58b]. Make exec understand .CMD files on Windows.
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index aff8836..382addd 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -897,7 +897,7 @@ TclpGetPid(
*
* The complete Windows search path is searched to find the specified
* executable. If an executable by the given name is not found,
- * automatically tries appending ".com", ".exe", and ".bat" to the
+ * automatically tries appending standard extensions to the
* executable name.
*
* Results:
@@ -1292,7 +1292,7 @@ ApplicationType(
Tcl_DString nameBuf, ds;
const TCHAR *nativeName;
TCHAR nativeFullPath[MAX_PATH];
- static const char extensions[][5] = {"", ".com", ".exe", ".bat"};
+ static const char extensions[][5] = {"", ".com", ".exe", ".bat", ".cmd"};
/*
* Look for the program as an external program. First try the name as it
@@ -1337,7 +1337,8 @@ ApplicationType(
Tcl_DStringFree(&ds);
ext = strrchr(fullName, '.');
- if ((ext != NULL) && (strcasecmp(ext, ".bat") == 0)) {
+ if ((ext != NULL) &&
+ (strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") == 0)) {
applType = APPL_DOS;
break;
}