[vim/vim] Avoid double slash in path concatenation for create_readdirex_item (PR #19241)

1 view
Skip to first unread message

mattn

unread,
Jan 22, 2026, 7:48:19 PM (16 hours ago) Jan 22
to vim/vim, Subscribed

Fixing #19188

On Cygwin and MSYS2, // has a special meaning: it is treated as a prefix for accessing network computers.
For example, //wsl$/ is used to access WSL.

In the current Vim implementation, the directory path passed to readdirex() and the file name found during traversal are concatenated using "/".
When the directory path already ends with /, this results in paths like:

"/" + "/" + "$Recycle.Bin"

which produces a //-prefixed path. Such paths are interpreted as network paths, so Vim ends up trying to retrieve the file size of a network computer named $Recycle.Bin, which is not intended.

From a correctness perspective on Windows, file size retrieval should be skipped for paths of the following forms:

 //host
 //host/share

However, as a first step, we should avoid generating // paths caused by redundant / concatenation in the first place.
The patch below addresses this by preventing unnecessary / insertion when constructing paths.


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

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

Commit Summary

  • a94714e Avoid double slash in path concatenation for create_readdirex_item

File Changes

(1 file)

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/19241@github.com>

Reply all
Reply to author
Forward
0 new messages