From 376265981d337461ba0a70928166a0c98cb70058 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Mon, 8 Dec 2014 17:34:11 +0800 Subject: [PATCH] Better `haxelib path ...` parsing. As suggested by Hugh in #139. --- 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 dcf3bb217..5282fcb70 100644 --- a/tools/hxcpp/PathManager.hx +++ b/tools/hxcpp/PathManager.hx @@ -114,10 +114,10 @@ class PathManager var lines = output.split("\n"); 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) { - if (StringTools.startsWith(StringTools.trim(lines[i]), "-D " + haxelib)) + if (re.match(StringTools.trim(lines[i]))) { result = StringTools.trim(lines[i - 1]); }