Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor pager path when checking less version #1903

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

dandavison
Copy link
Owner

No description provided.

@dandavison dandavison marked this pull request as ready for review November 13, 2024 15:50
@dandavison dandavison marked this pull request as draft November 13, 2024 15:50
use std::process::Command;

pub fn retrieve_less_version() -> Option<usize> {
if let Ok(less_path) = grep_cli::resolve_binary("less") {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@th1000s do you agree that it appears to be incorrect that here we use a hardcoded "less" as the name of the executable to resolve, despite one frame up the stack having obtained less_path via resolve_binary on the user's passed-in pager_path?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, your eyes do not deceive you :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

@dandavison dandavison marked this pull request as ready for review November 15, 2024 02:22
@dandavison dandavison merged commit d0ec139 into main Nov 15, 2024
13 checks passed
@dandavison dandavison deleted the tweak-less-code branch November 15, 2024 02:24
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.

2 participants