[vim/vim] executable() cannot find file in directory with single character name (PR #18979)

3 views
Skip to first unread message

MURAOKA Taro

unread,
10:41 AM (3 hours ago) 10:41 AM
to vim/vim, Subscribed

Problem: Only 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.

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.

Solution: The second argument of the after_pathsep() function is now passed the next pointer where a path separator may exist.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/18979

Commit Summary

  • aabce9a executable() cannot find file in directory with single character name

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18979@github.com>

Reply all
Reply to author
Forward
0 new messages