Skip to content

Commit

Permalink
Applied fixes from different PRs on tomblind repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismoh committed Oct 12, 2023
1 parent 54262e5 commit b5cb6c3
Show file tree
Hide file tree
Showing 3 changed files with 2,037 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ debugger/*.lua.map
extension/**/*.js
extension/**/*.js.map
node_modules
!lldebugger.lua
39 changes: 20 additions & 19 deletions debugger/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,25 +843,26 @@ export namespace Debugger {
}

function comparePaths(a: string, b: string) {
let aLen = a.length;
const bLen = b.length;
if (aLen === bLen) {
return a === b;
}
//Ensure 'a' is the shorter path
if (bLen < aLen) {
[a, aLen, b] = [b, bLen, a];
}
if (a !== b.sub(-aLen)) {
return false;
}
//If shorter string doesn't start with '/', make sure the longer one has '/' right before the substring
//so we don't match a partial filename.
if (a.sub(1, 1) === Path.separator) {
return true;
}
const bSep = -(aLen + 1);
return b.sub(bSep, bSep) === Path.separator;
// let aLen = a.length;
// const bLen = b.length;
// if (aLen === bLen) {
// return a === b;
// }
// //Ensure 'a' is the shorter path
// if (bLen < aLen) {
// [a, aLen, b] = [b, bLen, a];
// }
// if (a !== b.sub(-aLen)) {
// return false;
// }
// //If shorter string doesn't start with '/', make sure the longer one has '/' right before the substring
// //so we don't match a partial filename.
// if (a.sub(1, 1) === Path.separator) {
// return true;
// }
// const bSep = -(aLen + 1);
// return b.sub(bSep, bSep) === Path.separator;
return Path.getAbsolute(a) === Path.getAbsolute(b);
}

const debugHookStackOffset = 2;
Expand Down
Loading

0 comments on commit b5cb6c3

Please sign in to comment.