cars.cpp: Use entry type to recognise directories

Since the actual motivation behind GfCars::GfCars is to scan for
directories, checking against "CMakeLists.txt" is fragile since other
files could be listed as well, leading to undesired behaviour.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9620 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ec0e1670abc7c26b065e0225ecb8f9124515343d
Former-commit-id: 3010a5ed07c6b2f7e24f0af83318062e146198e6
This commit is contained in:
xavi92 2024-11-23 11:21:49 +00:00
parent ad796559ed
commit 9e82348cfb

View file

@ -96,9 +96,9 @@ GfCars::GfCars()
if (pFolder->name[0] == '.')
continue;
// Ignore "CMakeLists.txt"
if (strcmp(pFolder->name, "CMakeLists.txt") == 0)
if (pFolder->type != FList::dir) {
continue;
}
// Open the XML file of the car.
const char* pszCarId = pFolder->name;