Fix use of from root directory (resolve #1010)

This commit is contained in:
Joshua Granick
2017-08-02 10:36:24 -07:00
parent 32fb3a267d
commit 7bcfb5dc3f

View File

@@ -1905,10 +1905,15 @@ class CommandLineTools {
}
lastArgument = new Path (lastArgument).toString ();
var isRootDirectory = false;
if (((StringTools.endsWith (lastArgument, "/") && lastArgument != "/") || StringTools.endsWith (lastArgument, "\\")) && !StringTools.endsWith (lastArgument, ":\\")) {
if (PlatformHelper.hostPlatform == WINDOWS) {
lastArgument = lastArgument.substr (0, lastArgument.length - 1);
isRootDirectory = (lastArgument.length == 3 && lastArgument.charAt (1) == ":" && (lastArgument.charAt (2) == "/" || lastArgument.charAt (2) == "\\"));
} else {
isRootDirectory = (lastArgument == "/");
}
@@ -1919,7 +1924,7 @@ class CommandLineTools {
Sys.setCwd (lastArgument);
runFromHaxelib = true;
} else {
} else if (!isRootDirectory) {
arguments.push (lastArgument);