From c2e9d6d797b34b14e2bd963cccdce81962975dd2 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 12 Jul 2025 15:30:26 +0100 Subject: [PATCH] Fix haxelib path fallback functionality on windows The check on line 134 would never work properly on windows, because the line had a CR character so FileSystem.exists returned false. This meant that if a library was resolved via a name that doesn't exactly match the `-D` flag set by haxelib, e.g. Hxcpp instead of hxcpp or via an alias, then it would be reported as missing. --- tools/hxcpp/PathManager.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hxcpp/PathManager.hx b/tools/hxcpp/PathManager.hx index 15b83c7e7..3872bd30b 100644 --- a/tools/hxcpp/PathManager.hx +++ b/tools/hxcpp/PathManager.hx @@ -111,8 +111,8 @@ class PathManager catch (e:Dynamic) {} Log.verbose = cache; - - var lines = output.split("\n"); + + var lines = ~/\r?\n/g.split(output); var result = ""; var re = new EReg("^-D " + haxelib + "(=.*)?$", ""); //matches "-D hxcpp=3.1.0" or "-D hxcpp", but not "-D hxcpp-extras" for (i in 1...lines.length)