Skip to content

pgrep: The pattern is too long (more than 15 characters) and should be able to match pid correctly.#617

Open
Franklin-Qi wants to merge 2 commits intouutils:mainfrom
Franklin-Qi:bugfix-#121-long-length-pattern-matching-pids-is-avaiable
Open

pgrep: The pattern is too long (more than 15 characters) and should be able to match pid correctly.#617
Franklin-Qi wants to merge 2 commits intouutils:mainfrom
Franklin-Qi:bugfix-#121-long-length-pattern-matching-pids-is-avaiable

Conversation

@Franklin-Qi
Copy link

The PIDs should be obtained in advance. If the PIDs exist, it means the pattern matches, and there should be no length error.

Closes: #121

…e able to match pid correctly.

The PIDs should be obtained in advance. If the PIDs exist, it means the pattern matches, and there should be no length error.
@Franklin-Qi Franklin-Qi closed this Feb 4, 2026
@Franklin-Qi Franklin-Qi reopened this Feb 4, 2026
@dezgeg
Copy link
Contributor

dezgeg commented Feb 5, 2026

Would be better to add the check to find_matching_pids (I think), calling collect_matched_pids() will essentially halve performance of the program

@Franklin-Qi
Copy link
Author

Franklin-Qi commented Feb 5, 2026

Would be better to add the check to find_matching_pids (I think), calling collect_matched_pids() will essentially halve performance of the program

@dezgeg Thanks for the feedback. Calling the collect_matched_pids function twice does indeed impact performance. Moving the length error information to the subsequent find_matching_pids might be a better idea.

@Franklin-Qi Franklin-Qi force-pushed the bugfix-#121-long-length-pattern-matching-pids-is-avaiable branch from 3cac078 to aadf322 Compare February 5, 2026 03:43
@Franklin-Qi Franklin-Qi force-pushed the bugfix-#121-long-length-pattern-matching-pids-is-avaiable branch from aadf322 to 872c3cc Compare February 5, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pgrep: should show an error message if pattern is longer than 15 chars and there's no match

2 participants