From 1a591b3963a02ba7e3f9966b111578e61662ef21 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Mon, 10 Aug 2026 12:56:57 +0300 Subject: [PATCH] Avoid extra iteration for argument with a trailing slash --- libexec/pyenv-version-file | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/pyenv-version-file b/libexec/pyenv-version-file index a0309a65..e9fba30b 100755 --- a/libexec/pyenv-version-file +++ b/libexec/pyenv-version-file @@ -17,6 +17,7 @@ find_local_version_file() { # (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap04.html#tag_04_16) # even though few UNIX variants do that local unc; [[ $root =~ ^//[^/] && ! / -ef // ]] && unc=1 + root="${root%/}" # when testing root, $root is "" while true; do # don't test //.python-version if // is special