tgf/tgf.cpp: Return empty tgtPath on empty srcPath
Otherwise, even if srcPath is empty, a trailing '/' would be appended to tgtPath, and therefore it would not be possible to get an empty data directory if SD_DATADIR is undefined or empty.
This commit is contained in:
parent
522022fe1f
commit
d831bacfba
1 changed files with 1 additions and 1 deletions
|
@ -840,7 +840,7 @@ static char* makeRunTimeDirPath(const char* srcPath)
|
|||
strcpy(tgtPath, srcPath);
|
||||
|
||||
// Fix \ and add a trailing / is needed.
|
||||
if (tgtPath)
|
||||
if (tgtPath && strlen(tgtPath))
|
||||
GfPathNormalizeDir(tgtPath, bufSize - 1);
|
||||
|
||||
if (!tgtPath)
|
||||
|
|
Loading…
Reference in a new issue