HaxeFoundation / HaxeFoundation/haxe
Path.normalize(): wrong interpretation of double forward slashes
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Double forward slashes in paths seem to be interpreted as directories with empty names in `haxe.io.Path.normalize()`:
```haxe
class Test {
static function main() {
trace("Have:", haxe.io.Path.normalize("ProjectDir/Sources//../Assets"));
// Have: ProjectDir/Sources/Assets
trace("Want:", "ProjectDir/Assets");
}
}
```
[Try it online](https://try.haxe.org/#F8AC8d8e)
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).
Contributor guide
Assessment
This issue has not been assessed yet.