Remove bad default behavior of adding current working dir to default search path
This commit is contained in:
parent
611d5de179
commit
e7c32873ea
|
@ -150,14 +150,13 @@ bool S3D_FILENAME_RESOLVER::createPathList( void )
|
||||||
|
|
||||||
wxString kmod;
|
wxString kmod;
|
||||||
|
|
||||||
// add the current working directory as the first entry by
|
// add an entry for the default search path; at this point
|
||||||
// default; since CWD is not necessarily what we really want,
|
// we cannot set a sensible default so we use an empty string.
|
||||||
// the user may change this later with a call to SetProjectDir()
|
// the user may change this later with a call to SetProjectDir()
|
||||||
|
|
||||||
S3D_ALIAS lpath;
|
S3D_ALIAS lpath;
|
||||||
lpath.m_alias = _( "(DEFAULT)" );
|
lpath.m_alias = _( "(DEFAULT)" );
|
||||||
lpath.m_pathvar = _( "(PROJECT DIR)" );
|
lpath.m_pathvar = _( "${PROJDIR}" );
|
||||||
lpath.m_pathexp = wxFileName::GetCwd();
|
|
||||||
lpath.m_description = _( "Current project directory" );
|
lpath.m_description = _( "Current project directory" );
|
||||||
m_Paths.push_back( lpath );
|
m_Paths.push_back( lpath );
|
||||||
|
|
||||||
|
@ -275,7 +274,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||||
// check the path relative to the current project directory;
|
// check the path relative to the current project directory;
|
||||||
// note: this is not necessarily the same as the current working
|
// note: this is not necessarily the same as the current working
|
||||||
// directory, which has already been checked
|
// directory, which has already been checked
|
||||||
do
|
if( !sPL->m_pathexp.empty() )
|
||||||
{
|
{
|
||||||
wxFileName fpath( wxFileName::DirName( sPL->m_pathexp ) );
|
wxFileName fpath( wxFileName::DirName( sPL->m_pathexp ) );
|
||||||
wxString fullPath = fpath.GetPathWithSep() + tname;
|
wxString fullPath = fpath.GetPathWithSep() + tname;
|
||||||
|
@ -291,7 +290,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||||
|
|
||||||
return tname;
|
return tname;
|
||||||
}
|
}
|
||||||
} while( 0 );
|
}
|
||||||
|
|
||||||
++sPL; // skip to item 2: KISYS3DMOD
|
++sPL; // skip to item 2: KISYS3DMOD
|
||||||
|
|
||||||
|
@ -334,7 +333,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||||
|
|
||||||
while( sPL != ePL )
|
while( sPL != ePL )
|
||||||
{
|
{
|
||||||
if( !sPL->m_alias.Cmp( alias ) )
|
if( !sPL->m_alias.Cmp( alias ) && !sPL->m_pathexp.empty() )
|
||||||
{
|
{
|
||||||
wxFileName fpath( wxFileName::DirName( sPL->m_pathexp ) );
|
wxFileName fpath( wxFileName::DirName( sPL->m_pathexp ) );
|
||||||
wxString fullPath = fpath.GetPathWithSep() + relpath;
|
wxString fullPath = fpath.GetPathWithSep() + relpath;
|
||||||
|
@ -443,7 +442,7 @@ bool S3D_FILENAME_RESOLVER::addPath( const S3D_ALIAS& aPath )
|
||||||
}
|
}
|
||||||
|
|
||||||
// aliases with the same m_pathexp are acceptable (one or both
|
// aliases with the same m_pathexp are acceptable (one or both
|
||||||
// aliases being testes may be expanded variables) but when shortening
|
// aliases being tested may be expanded variables) but when shortening
|
||||||
// names the preference is for (a) a fully specified path in m_pathvar
|
// names the preference is for (a) a fully specified path in m_pathvar
|
||||||
// then (b) the more senior alias in the list
|
// then (b) the more senior alias in the list
|
||||||
if( !sPL->m_pathexp.empty() && !tpath.m_pathexp.empty() )
|
if( !sPL->m_pathexp.empty() && !tpath.m_pathexp.empty() )
|
||||||
|
|
Loading…
Reference in New Issue