Only truncate the programPath if it's followed by an EOL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4847 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
0f71381685
commit
fbf8efefde
|
@ -84,7 +84,10 @@ static std::string getProgramPath(const char* programCommand)
|
|||
|
||||
if (!programPath.empty())
|
||||
{
|
||||
programPath.erase(programPath.find('\n')); // `which' adds a \n which confuses exec()
|
||||
// `which' adds a \n which confuses exec()
|
||||
std::string::size_type eol = programPath.find('\n');
|
||||
if (eol != std::string::npos)
|
||||
programPath.erase(eol);
|
||||
debug(LOG_WZ, "Found us at %s", programPath.c_str());
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue