From 4bfa9cac85a450e4ee2f8e77555bd5878b27a6a5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 26 May 2011 20:18:27 +0100 Subject: [PATCH] Used the simgear strutils helper, fixing a corner-case ThorstenB spotted. --- src/Airports/xmlloader.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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"); } -- 2.39.5