diff --git a/SystemTools.cxx b/SystemTools.cxx
index 1b88a1bc0fe5084201403378aea7f0078dd5ca4d..e073cbf911e9dad4e5e66db728c1828bf83952f7 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -3276,7 +3276,7 @@ void SystemTools::CheckTranslationPath(std::string& path)
   // Now convert any path found in the table back to the one desired:
   for (auto const& pair : SystemTools::Statics->TranslationMap) {
     // We need to check of the path is a substring of the other path
-    if (path.find(pair.first) == 0) {
+    if (path.compare(0, pair.first.size(), pair.first) == 0) {
       path = path.replace(0, pair.first.size(), pair.second);
     }
   }