Skip to content

Commit e12e2c3

Browse files
committed
Trim away correct path separator according to host system
Otherwise assembly path given to backend on decompilation could get invalid on Windows systems.
1 parent a62b888 commit e12e2c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vscode-extension/src/decompiler/nodeUri.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ export function uriToNode(uri: vscode.Uri): NodeMetadata | undefined {
6464

6565
function trimLeadingSlashes(input: string) {
6666
let result = input;
67-
if (result.startsWith("/")) {
67+
if (result.startsWith(path.sep)) {
6868
result = result.substring(1);
6969
}
7070
return result;
7171
}
7272

7373
function trimTrailingSlashes(input: string) {
7474
let result = input;
75-
if (result.endsWith("/")) {
75+
if (result.endsWith(path.sep)) {
7676
result = result.slice(0, -1);
7777
}
7878
return result;

0 commit comments

Comments
 (0)