]> git.feebdaed.xyz Git - 0xmirror/vim.git/commit
patch 9.1.2004: MS-Windows: executable() cannot find file in directory with single...
authorMuraoka Taro <koron.kaoriya@gmail.com>
Sun, 21 Dec 2025 19:19:39 +0000 (19:19 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Dec 2025 19:19:39 +0000 (19:19 +0000)
commitbd686d85dc2b1488ab10c723125d654e0e2d7ef4
treec75b62a5b74dbcada3028c40c7f11e8e67ef2b9f
parente09ff341294dbdd5c2db2342efc564ba34444571
patch 9.1.2004: MS-Windows: executable() cannot find file in directory with single char

Problem:  MS-Windows: If a directory with a single character name is
          included in the PATH environment variable without a trailing
          path separator, executable() will not be able to find the
          executable file under it.
Solution: The second argument of the after_pathsep() function is now
          passed the next pointer where a path separator may exist
          (Muraoka Taro).

As a specific example, the default installation path for PowerShell v7
is "C:\Program Files\PowerShell\7", but if you set this as is in the
PATH environment variable, Vim will not be able to find the pwsh.exe
command. In this case, Vim will try to search for "C:\Program
Files\PowerShell\7pwsh.exe".

Cause: The after_pathsep() function determines whether the location
passed as its second argument immediately follows a path separator.
However, in the code where the problem occurred, the second argument was
passed a location that might contain a path separator. As a result, it
was mistakenly determined that a path separator was present in cases
where the final directory name was a single character and not followed
by a path separator, and the path to search was incorrect.

closes: #18979

Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_win32.c
src/testdir/test_functions.vim
src/version.c