From 5aa38c36f80cdb7ae7bfbb1922b6fb133bad9fe6 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 2 Feb 2026 20:23:45 +0100 Subject: [PATCH] lib/pager: Do not resolve directories with PATH If PAGER contains any slash in program part, avoid resolving it with PATH environment variable. Even if it is found there (in a subdirectory), sh -c won't execute it. Signed-off-by: Tobias Stoeckmann --- lib/pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pager.c b/lib/pager.c index 9cbf6383f..aec94e2d0 100644 --- a/lib/pager.c +++ b/lib/pager.c @@ -136,7 +136,7 @@ static int has_command(const char *cmd) if (!b) goto cleanup; - if (*b == '/') { + if (strchr(b, '/')) { rc = access(b, X_OK) == 0; goto cleanup; } -- 2.47.3