ignore CMakeLists.txt because it's not a directory

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

Former-commit-id: 5972798e5b6629bc37a46c393af3d8ac494f939f
Former-commit-id: f50cbf697f38bacc2a93c71656724efe9eee8149
This commit is contained in:
iobyte 2022-08-29 17:10:16 +00:00
parent 2fceba177b
commit a1ad780f48
2 changed files with 22 additions and 6 deletions

View file

@ -95,6 +95,10 @@ GfCars::GfCars()
// Ignore "." and ".." folders.
if (pFolder->name[0] == '.')
continue;
// Ignore "CMakeLists.txt"
if (strcmp(pFolder->name, "CMakeLists.txt") == 0)
continue;
// Open the XML file of the car.
const char* pszCarId = pFolder->name;
@ -104,7 +108,7 @@ GfCars::GfCars()
void* hparmCar = GfParmReadFile(ossCarFileName.str(), GFPARM_RMODE_STD);
if (!hparmCar)
{
GfLogInfo("Ignoring car %s (file %s not %s)\n",
GfLogError("Ignoring car %s (file %s not %s)\n",
pszCarId, ossCarFileName.str().c_str(),
GfFileExists(ossCarFileName.str().c_str()) ? "readable" : "found");
continue;
@ -120,7 +124,7 @@ GfCars::GfCars()
void* hparmCat = GfParmReadFile(ossCatFileName.str(), GFPARM_RMODE_STD);
if (!hparmCat)
{
GfLogInfo("Ignoring car %s (category file %s not %s)\n",
GfLogError("Ignoring car %s (category file %s not %s)\n",
pszCarId, ossCatFileName.str().c_str(),
GfFileExists(ossCatFileName.str().c_str()) ? "readable" : "found");
GfParmReleaseHandle(hparmCar);

View file

@ -101,7 +101,11 @@ GfTracks::GfTracks()
const char* pszCatId = pCatFolder->name;
if (pszCatId[0] == '.')
continue;
// Ignore "CMakeLists.txt"
if (strcmp(pszCatId, "CMakeLists.txt") == 0)
continue;
// Get the list of sub-dirs in the "tracks" folder (the track categories).
std::string strDirName("tracks/");
strDirName += pszCatId;
@ -120,17 +124,25 @@ GfTracks::GfTracks()
do
{
//GfLogDebug("GfTracks::GfTracks() : Examining track %s\n", pTrackFolder->name);
// Determine and check the XML file of the track.
const char* pszTrackId = pTrackFolder->name;
// Ignore "." and ".." folders.
if (pszTrackId[0] == '.')
continue;
// Ignore "CMakeLists.txt"
if (strcmp(pszTrackId, "CMakeLists.txt") == 0)
continue;
std::ostringstream ossFileName;
ossFileName << "tracks/" << pszCatId << '/' << pszTrackId
<< '/' << pszTrackId << '.' << TRKEXT;
const std::string strTrackFileName(ossFileName.str());
if (!GfFileExists(strTrackFileName.c_str()))
{
GfLogInfo("Ignoring track %s : %s not found\n",
GfLogError("Ignoring track %s : %s not found\n",
pszTrackId, strTrackFileName.c_str());
continue;
}