citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 15f4f803c9c5e2be92b1a395d45350f8f0a2318d
parent 2752f5afc062225a32abf5d02f5a70be03feb6ed
Author: Kyle Milz <kyle@windows.krwm.net>
Date:   Sun, 15 Jan 2017 14:28:09 -0800

inst: use find_if for win32 too

Diffstat:
Minst_fewin32.cc | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/inst_fewin32.cc b/inst_fewin32.cc @@ -18,6 +18,7 @@ #include <windows.h> // CreateProcess #include <Shlwapi.h> // PathFindOnPath +#include <array> #include <cstdio> // tmpnam #include <cstring> // strcmp #include <fstream> // ifstream, ofstream @@ -132,7 +133,8 @@ InstFrontendWin32::fork_compiler() char real_cc[MAX_PATH]; std::strcpy(real_cc, m_args[0]); - if (!ends_with(real_cc, ".exe") && !ends_with(real_cc, ".EXE")) + std::array<std::string, 2> exts = {{ ".exe", ".EXE" }}; + if (std::find_if(exts.begin(), exts.end(), ends_with(real_cc)) == exts.end()) std::strcat(real_cc, ".exe"); if (PathFindOnPathA(real_cc, NULL) == FALSE)