From 4d3a2fd1cddea17cf2250a77a808fafdaca91530 Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 19 Oct 2014 01:31:14 -0700 Subject: [PATCH 1/3] Use a regex to split the hxml file. Allows skipping the "replace newlines with spaces" step, and ensures that there aren't any blank arguments. --- tools/platforms/FlashPlatform.hx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index fbba8c1b4..a6f617e27 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -67,10 +67,9 @@ class FlashPlatform extends PlatformTarget { } - hxml = StringTools.replace (hxml, "\n", " "); hxml = StringTools.trim (hxml); - var args = hxml.split (" "); + var args = new EReg ("\\s+", "g").split (hxml); var strip; while ((strip = args.indexOf ("-swf-header")) > -1) { @@ -298,4 +297,4 @@ class FlashPlatform extends PlatformTarget { @ignore public override function trace ():Void {} @ignore public override function uninstall ():Void {} -} \ No newline at end of file +} From 029c5009a9d9cb536c7485d0ac2deb96e4b3117b Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 19 Oct 2014 01:50:30 -0700 Subject: [PATCH 2/3] Merge consecutive arguments that don't start with - Otherwise, if the app title contains a space, it'll be passed as two separate arguments and Haxe won't know what to do with it. --- tools/platforms/FlashPlatform.hx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index a6f617e27..058d37230 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -78,6 +78,23 @@ class FlashPlatform extends PlatformTarget { } + var index = 2; + + while (index < args.length) { + + if (!StringTools.startsWith (args[index - 1], "-") && !StringTools.startsWith (args[index], "-")) { + + args[index - 1] += " " + args[index]; + args.splice (index, 1); + + } else { + + index++; + + } + + } + if (PlatformHelper.hostPlatform != Platform.WINDOWS) { for (i in 0...args.length) { From e8f3b83dd8e793bf6cda6cbfe21e07d90cbbc767 Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 19 Oct 2014 10:34:41 -0700 Subject: [PATCH 3/3] Don't skip the first argument. (See comments on previous commit.) --- tools/platforms/FlashPlatform.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index 058d37230..cc6656261 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -78,7 +78,7 @@ class FlashPlatform extends PlatformTarget { } - var index = 2; + var index = 1; while (index < args.length) {