From: James Turner Date: Thu, 26 May 2011 19:18:27 +0000 (+0100) Subject: Used the simgear strutils helper, fixing a corner-case ThorstenB spotted. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4bfa9cac85a450e4ee2f8e77555bd5878b27a6a5;p=flightgear.git Used the simgear strutils helper, fixing a corner-case ThorstenB spotted. --- diff --git a/src/Airports/xmlloader.cxx b/src/Airports/xmlloader.cxx index b5bce6345..3d65f7756 100644 --- a/src/Airports/xmlloader.cxx +++ b/src/Airports/xmlloader.cxx @@ -14,8 +14,8 @@ // #include - #include +#include #include
#include
@@ -85,8 +85,7 @@ bool XMLLoader::findAirportData(const std::string& aICAO, const std::string& aFileName, SGPath& aPath) { string fileName(aFileName); - int extPos = fileName.size() - 4; - if ((int) fileName.rfind(".xml") != extPos) { + if (!simgear::strutils::ends_with(aFileName, ".xml")) { fileName.append(".xml"); }