<div>Hi,</div>
<div> </div>
<div>How about this::</div>
<div> </div>
<div>Index: lib/Support/Windows/Program.inc<br>===================================================================<br>--- lib/Support/Windows/Program.inc (revision 128469)<br>+++ lib/Support/Windows/Program.inc (working copy)<br>
@@ -163,7 +163,11 @@<br> Data_ = 0;<br> }<br> <br>- if (!path.canExecute()) {<br>+ Path platformPath(path);<br>+ if (strstr(platformPath.c_str(), ".exe") == NULL)<br>+ platformPath.appendSuffix("exe");<br>
+<br>+ if (!platformPath.canExecute()) {<br> if (ErrMsg)<br> *ErrMsg = "program not executable";<br> return false;<br>@@ -276,7 +280,7 @@<br> <br> fflush(stdout);<br> fflush(stderr);<br>- BOOL rc = CreateProcess(path.c_str(), command, NULL, NULL, TRUE, 0,<br>
+ BOOL rc = CreateProcess(platformPath.c_str(), command, NULL, NULL, TRUE, 0,<br> envblock, NULL, &si, &pi);<br> DWORD err = GetLastError();<br> <br>@@ -290,7 +294,7 @@<br> if (!rc) {<br>
SetLastError(err);<br> MakeErrMsg(ErrMsg, std::string("Couldn't execute program '") +<br>- path.str() + "'");<br>+ platformPath.str() + "'");<br>
return false;<br> }<br> Win32ProcessInfo* wpi = new Win32ProcessInfo;<br></div>
<div>Apparently, FindProgramByName doesn't need a file extension, as the underlying SearchPath call doesn't need it.</div>
<div> </div>
<div>-John</div>
<div><br><br> </div>
<div class="gmail_quote">On Sun, Mar 27, 2011 at 10:47 PM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com">geek4civic@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">John,<br><br>On Thu, Mar 17, 2011 at 3:40 AM, John Thompson<br>
<div class="im"><<a href="mailto:john.thompson.jtsoftware@gmail.com">john.thompson.jtsoftware@gmail.com</a>> wrote:<br></div>
<div class="im">> Index: utils/not/not.cpp<br>> ===================================================================<br>> --- utils/not/not.cpp (revision 127522)<br>> +++ utils/not/not.cpp (working copy)<br>> @@ -15,6 +15,11 @@<br>
> int main(int argc, const char **argv) {<br>> sys::Path Program = sys::Program::FindProgramByName(argv[1]);<br>><br>> +#if defined(_MSC_VER)<br>> + if (strstr(Program.c_str(), ".exe") == NULL)<br>
> + Program.appendSuffix("exe");<br>> +#endif<br>> +<br>> std::string ErrMsg;<br>> int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,<br>> &ErrMsg);<br>
<br></div>I don't think it would be a right fix.<br><br> - sys::Program::FindProgramByName() should canonicalize a pathname<br> - sys::Program::ExecuteAndWait() should accept "x:/path/to/foo"<br>(without .exe).<br>
<br>Even if this patch were the right fix, I don't understand why this is<br>MSC-specific. It might be _WIN32 not _MSC_VER.<br><font color="#888888"><br>...Takumi<br></font></blockquote></div><br><br clear="all"><br>-- <br>
John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>