Repository navigation
Conversation
pranshuparmar
requested changes
Nov 21, 2026
pranshuparmar
left a comment
Owner
There was a problem hiding this comment.
- The branch includes #252’s commit (0e08118, uppercase hex IDs), which we’re closing. Please rebase onto staging with only this fix, and retarget the PR to staging.
- This only covers -x. Plain witr "" still lists every process, since every name contains the empty string.
- An empty name is invalid input, so it should exit 4 with a clear message, but witr -x "" now exits 2 (“not found”). Rejecting it in target.Resolve covers both modes and every platform. The matcher check can stay as a backstop.
An empty target name matched every process because every name contains the empty string. Reject it in Resolve so both plain and -x modes fail with a clear error on every platform, and keep the matchesExactToken guard as a backstop. Signed-off-by: CJstate <142857225+CJstate@users.noreply.github.com>
CJstate
force-pushed
the
fix/empty-name-exact-match
branch
from
November 25, 2026 04:17
6e9e3f4 to
39129c5
Compare
Contributor
Author
|
Addressed all three points. Rebased onto current staging with only this fix (the #252 uppercase-hex commit is gone), and an empty name is now rejected in |
This branch has not been deployed
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.
matchesExactTokensplits each command-line argument on/(and\) and compares every segment withname. With an emptyname, the first empty segment of any absolute path matches, somatchesExactToken("/usr/bin/foo", "")returned true. All four platforms call this function in exact-name resolution.An empty name is never a valid process base name, so return false up front. Test covers an absolute path with an empty needle.
RED: the new case failed on the original function. GREEN:
go test ./internal/targetpasses.