Skip to content

Commit

Permalink
Merge pull request #161 from ngageoint/windowsFix
Browse files Browse the repository at this point in the history
Handle spaces in Windows pathnames
  • Loading branch information
asylvest authored Feb 23, 2017
2 parents 7a9ed95 + 22065a5 commit 4c12886
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions six/modules/c++/six.sidd/tests/test_sidd_blocking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,25 @@ class TempFileWithExtension
std::string getProgramPathname(const std::string& installPathname,
const std::string& programName)
{
const sys::Path testPath = sys::Path(installPathname).join("bin").
join(programName);
const std::string testPathname = testPath.exists() ? testPath.getPath() :
testPath.getPath() + ".exe";
std::string testPathname = str::toString(sys::Path(installPathname).
join("bin").join(programName));

if (!sys::OS().exists(testPathname))
{
testPathname += ".exe";
}

if (!sys::OS().exists(testPathname))
{
throw except::Exception(Ctxt("Unable to find " + testPathname));
}

// Clean it up so path is readable
if (str::contains(testPathname, " "))
{
testPathname = "\"" + testPathname + "\"";
}

return testPathname;
}

Expand Down

0 comments on commit 4c12886

Please sign in to comment.