Skip to content

Commit b14dd02

Browse files
committed
better fix to WINDNINJA_DATA related errors and warning messages, now even if WINDNINJA_DATA is set to a valid path, it only passes if the path contains WINDNINJA_DATA things
1 parent d0ce50f commit b14dd02

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ninja/ninja_init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ int NinjaInitialize(const char* typeofrun)
300300
** Set windninja data if it isn't set.
301301
*/
302302
std::string wnDataPath = CPLGetConfigOption("WINDNINJA_DATA", "FALSE");
303-
if( !CPLCheckForFile((char*)wnDataPath.c_str(), NULL) )
303+
if( !CPLCheckForFile((char*)CPLFormFilename(wnDataPath.c_str(),"tz_world.zip",NULL), NULL) )
304304
{
305305
CPLDebug( "WINDNINJA", "WINDNINJA_DATA \"%s\" is not valid, attempting to find valid WINDNINJA_DATA", wnDataPath.c_str() );
306306
std::string osDataPath;

src/ninja/ninjafoam.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ bool NinjaFoam::simulate_wind()
134134
CPLDebug("NINJAFOAM", CPLSPrintf("foamVersion = \"%s\"",foamVersion.c_str()));
135135

136136
std::string pszWnDataPath = CPLGetConfigOption( "WINDNINJA_DATA", NULL );
137-
if( !CPLCheckForFile((char*)pszWnDataPath.c_str(), NULL) )
137+
if( !CPLCheckForFile((char*)CPLFormFilename(pszWnDataPath.c_str(),"tz_world.zip",NULL), NULL) )
138138
{
139139
throw std::runtime_error("invalid WINDNINJA_DATA path for ninjafoam.");
140140
}

0 commit comments

Comments
 (0)