Skip to content

Commit

Permalink
Strip leading / from paths when normalizing on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Apr 22, 2024
1 parent 6913461 commit fa430c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform/filesystem.nim
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ else:
let fs*: FileSystem = new FileSystemDesktop
fs.init getAppDir()

const stripLeading = defined(windows)

proc normalizePathUnix*(path: string): string =
return path.normalizedPath.replace('\\', '/').strip(leading=false, chars={'/'})
return path.normalizedPath.replace('\\', '/').strip(leading=stripLeading, chars={'/'})

proc `//`*(a: string, b: string): string = (a / b).normalizePathUnix

0 comments on commit fa430c4

Please sign in to comment.