Skip to content

Commit

Permalink
Path util fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed May 18, 2024
1 parent 39939ab commit 2afcbff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/Sources/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ function path_to_relative(from: string, to: string): string {
}
}
let base: string = "";
for (let i: i32 = 0; i < a.length - 1; ++i) {
for (let i: i32 = 0; i < a.length; ++i) {
base += ".." + path_sep;
}
base += string_array_join(b, path_sep);
return base;
}

function path_normalize(path: string): string {
if (ends_with(path, path_sep)) {
path = substring(path, 0, path.length - 1);
}
let ar: string[] = string_split(path, path_sep);
let i: i32 = 0;
while (i < ar.length) {
Expand Down

0 comments on commit 2afcbff

Please sign in to comment.