fix: keep trailing-slash deobfuscation scoped - #186
Merged
junior-ricon merged 1 commit intoJul 28, 2026
Merged
Conversation
junior-ricon
merged commit Jul 28, 2026
9e8f779
into
junior/deobfuscate-path-builtins
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finding
PR #185 replaces
basenamewith${arg##*/}for scoped deobfuscation. Unlikebasename, that expansion returns an empty string for a path ending in/. Passingnotes/<id>/therefore leaves no non-empty scoped ID, selects full mode, and restores every note instead of only the requested note.This fix removes trailing slashes before taking the final path component, using Bash 3.2-compatible parameter expansion. The regression proves only the selected note is restored and would fail on PR #185's exact head.
Validation
8c91b5f902943a893b06bd1f48968a77d2478b06: failed as expected because all three notes were restoredmise run test test/deobfuscate.bats: 30 passedmise run test: 415 BATS passed, 9 Python passedcodebase lint "$PWD": 8 rules passedmise run doctor: required checks passed; optional clone-local pre-commit hook is not installedreadme build --checkbash -n .mise/tasks/deobfuscate lib/obfuscate.shgit diff --checkFix-it for #185. Base is
junior/deobfuscate-path-builtins; this PR does not targetmain.