Revert commit bc0306ba as it did not fix the issue.

This commit is contained in:
Wayne Stambaugh 2017-11-22 15:54:18 -05:00
parent 59e5d3b762
commit 78366f8f0b
2 changed files with 9 additions and 19 deletions

View File

@ -56,7 +56,7 @@ static bool normalizeAbsolutePaths( const wxFileName& aPathA,
{
while( i < bDirs.GetCount() )
{
*aResultPath += bDirs[i] + "/";
*aResultPath += bDirs[i] + wxT( "/" );
i++;
}
}
@ -70,7 +70,6 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars
{
wxFileName envPath;
wxString tmp, varName, normalizedFullPath;
bool hasTrailingSeparator = false;
if( aEnvVars )
{
@ -81,12 +80,6 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars
|| !wxFileName::IsDirReadable( entry.second.GetValue() ) )
continue;
// Do not add separator to the end of environment variable if it already has one.
wxUniChar separator = entry.second.GetValue().Last();
if( separator == '\\' || separator == '/' )
hasTrailingSeparator = true;
envPath.SetPath( entry.second.GetValue() );
if( normalizeAbsolutePaths( envPath, aFilePath, &tmp ) )
@ -107,10 +100,7 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars
if( !varName.IsEmpty() )
{
normalizedFullPath = wxString::Format( "${%s}", varName );
if( !hasTrailingSeparator )
normalizedFullPath += "/";
normalizedFullPath = wxString::Format( "${%s}/", varName );
if( !tmp.IsEmpty() )
normalizedFullPath += tmp;

View File

@ -28,10 +28,10 @@
#include <pgm_base.h>
/**
* Normalize a file path to an environmental variable, if possible.
* Normalizes a file path to an environmental variable, if possible.
*
* @param aFilePath is the full file path (path and file name) to be normalized.
* @param aEnvVars is an optional map of environmental variables to try substitution with.
* @param aEnvVars is an optional map of environmental variables to try substition with.
* @param aProject is an optional project, to normalize the file path to the project path.
* @return Normalized full file path (path and file name) if succeeded or empty string if the
* path could not be normalized.
@ -40,12 +40,12 @@ wxString NormalizePath( const wxFileName& aFilePath, const ENV_VAR_MAP* aEnvVars
const PROJECT* aProject );
/**
* Search the default paths trying to find one with the requested file.
* Searches the default paths trying to find one with the requested file.
*
* @param aFileName is the name of the searched file. It might be a relative path.
* @param aEnvVars is an optional map of environmental variables that can contain paths.
* @param aProject is an optional project, to check the project path.
* @return Full path (path and file name) if the file was found in one of the paths, otherwise
* @return Full path (apth and file name) if the file was found in one of the paths, otherwise
* an empty string.
*/
wxString ResolveFile( const wxString& aFileName, const ENV_VAR_MAP* aEnvVars,