haxe
haxe copied to clipboard
Path.normalize(): wrong interpretation of double forward slashes
Double forward slashes in paths seem to be interpreted as directories with empty names in haxe.io.Path.normalize():
class Test {
static function main() {
trace("Have:", haxe.io.Path.normalize("ProjectDir/Sources//../Assets"));
// Have: ProjectDir/Sources/Assets
trace("Want:", "ProjectDir/Assets");
}
}
The double forward slashes should be reduced to a single one and only then ../ should be evaluated. I'm a bit unsure whether the current situation is by design, but Python's os.path.normpath() for example works like intended with this example (have == want).