aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-04 16:05:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-04 16:05:32 +0200
commit91a0464af4330e7ac1ada421c3014903a390b11a (patch)
tree2478f4b1b988962e5baff650d34acc9fb7ed82ca
parent6a20f908a107e1eac0904543c9fc7c23260030c6 (diff)
If MSYS detection fails, assume executable is not MSYS-based rather than is
The conservative bet proved to be too slow.
-rw-r--r--libbutl/process.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbutl/process.cxx b/libbutl/process.cxx
index 2260213..72f18ee 100644
--- a/libbutl/process.cxx
+++ b/libbutl/process.cxx
@@ -1266,7 +1266,7 @@ namespace butl
// 3. Apparently switching from 32 to 64-bit should help (less chance
// for address collisions).
//
- // 4. Rebase all the Cygwin DLLs (this is a topic for a another episode).
+ // 4. Rebase all the Cygwin DLLs (this is a topic for another episode).
//
// To add to this list, we also have our own remedy (which is not
// generally applicable):
@@ -1296,8 +1296,8 @@ namespace butl
// 2. We can only load an image of the same width as us (32/64-bit).
//
// 3. If something goes wrong (width mismatch, failed to load, etc),
- // then we assume it is MSYS for safety. Better run slow than not run
- // at all, right?
+ // then we assume it is not MSYS (we used to do it the other way
+ // around for safety but that proved to be too slow).
//
auto detect_msys = [] (const char* p) -> bool
{
@@ -1311,7 +1311,7 @@ namespace butl
ImageLoad (p, nullptr), deleter);
if (img == nullptr)
- return true;
+ return false;
if (img->FileHeader->OptionalHeader.NumberOfRvaAndSizes < 2)
return false;
@@ -1355,7 +1355,7 @@ namespace butl
img->FileHeader->OptionalHeader.DataDirectory[1].VirtualAddress)));
if (imp == nullptr)
- return true;
+ return false;
for (; imp->Name != 0 || imp->TimeDateStamp != 0; ++imp)
{