Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 5817a1dfe..1debb93c3 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -1058,9 +1058,13 @@ spawnvpe (int mode, const char *file, const char * const *argv,
int
av::fixup (const char *prog_arg, path_conv& real_path, const char *ext)
{
+ const char *p;
bool exeext = strcasematch (ext, ".exe");
- if (exeext && real_path.iscygexec () || strcasematch (ext, ".bat")
- || strcasematch (ext, ".cmd"))
+ if (exeext && real_path.iscygexec () || strcasematch (ext, ".bat"))
+ return 0;
+ if (!*ext && ((p = ext - 4) > (char *) real_path)
+ && (strcasematch (p, ".bat") || strcasematch (p, ".cmd")
+ || strcasematch (p, ".btm"))
return 0;
while (1)
{