[flang-commits] [flang] [flang] Fix extra "./" prefix in source file paths (PR #186212)

Caroline Newcombe via flang-commits flang-commits at lists.llvm.org
Sun Mar 15 19:10:37 PDT 2026


================
@@ -81,9 +93,15 @@ std::vector<std::string> LocateSourceFileAll(
     return {name};
   }
   std::vector<std::string> result;
+  // Normalize: strip leading "./" to avoid "././file" with "." search paths.
+  llvm::StringRef nameRef(name);
+  if (nameRef.starts_with("./")) {
+    nameRef = nameRef.substr(2);
+  }
+  std::string normalizedName = nameRef.str();
----------------
cenewcombe wrote:

This was a bad idea. Fixed!

https://github.com/llvm/llvm-project/pull/186212


More information about the flang-commits mailing list