mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Fix for the directory scan for modules so it doesn't trim off characters in the path.
Resubmitted to clear the excess history entries.
This commit is contained in:
parent
c44d827c41
commit
c2da755dc2
1 changed files with 17 additions and 6 deletions
|
|
@ -1321,6 +1321,7 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve
|
||||||
dsize_t subtrLen = subPath ? dStrlen(subPath) : 0;
|
dsize_t subtrLen = subPath ? dStrlen(subPath) : 0;
|
||||||
char trail = trLen > 0 ? basePath[ trLen - 1 ] : '\0';
|
char trail = trLen > 0 ? basePath[ trLen - 1 ] : '\0';
|
||||||
char subTrail = subtrLen > 0 ? subPath[ subtrLen - 1 ] : '\0';
|
char subTrail = subtrLen > 0 ? subPath[ subtrLen - 1 ] : '\0';
|
||||||
|
char subLead = subtrLen > 0 ? subPath[0] : '\0';
|
||||||
|
|
||||||
if( trail == '/' )
|
if( trail == '/' )
|
||||||
{
|
{
|
||||||
|
|
@ -1380,13 +1381,23 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve
|
||||||
{
|
{
|
||||||
if( ( subPath && ( dStrncmp( subPath, "", 1 ) != 0 ) ) )
|
if( ( subPath && ( dStrncmp( subPath, "", 1 ) != 0 ) ) )
|
||||||
{
|
{
|
||||||
char szPath [ 1024 ];
|
char szPath[1024];
|
||||||
dMemset( szPath, 0, 1024 );
|
dMemset(szPath, 0, 1024);
|
||||||
if( trail != '/' )
|
if (trail == '/')
|
||||||
dSprintf( szPath, 1024, "%s%s", basePath, subPath );
|
{
|
||||||
|
if (subLead == '/')
|
||||||
|
dSprintf(szPath, 1024, "%s%s", basePath, &subPath[1]);
|
||||||
|
else
|
||||||
|
dSprintf(szPath, 1024, "%s%s", basePath, subPath);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dSprintf( szPath, 1024, "%s%s", basePath, &subPath[1] );
|
{
|
||||||
directoryVector.push_back( StringTable->insert( szPath ) );
|
if (subLead == '/')
|
||||||
|
dSprintf(szPath, 1024, "%s%s", basePath, subPath);
|
||||||
|
else
|
||||||
|
dSprintf(szPath, 1024, "%s/%s", basePath, subPath);
|
||||||
|
}
|
||||||
|
directoryVector.push_back(StringTable->insert(szPath));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
directoryVector.push_back( StringTable->insert( basePath ) );
|
directoryVector.push_back( StringTable->insert( basePath ) );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue