diff options
| author | tao <2471314@gmail.com> | 2026-06-03 06:59:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-02 18:59:13 -0400 |
| commit | 13b2b1427578bec7714e1a14be44ca72ef18f379 (patch) | |
| tree | 00bf2a82138f59caf1d20379302d48efb88fa1ce /test/functional/vimscript/executable_spec.lua | |
| parent | 738cd366f99e2bdf9b7c55b292997c934845a109 (diff) | |
| download | rneovim-13b2b1427578bec7714e1a14be44ca72ef18f379.tar.gz rneovim-13b2b1427578bec7714e1a14be44ca72ef18f379.tar.bz2 rneovim-13b2b1427578bec7714e1a14be44ca72ef18f379.zip | |
fix(path): prevent infinite loop when re-editing file without drive-letter
Problem:
Edit a file with a drive-letter path, then re-edit it without the drive letter
and colon. This cause `path_fnamencmp` to loop infinitely as `len` never
reaches 0, while `c1` and `c2` are already NUL.
Commit e18a578 accidentally used || before `(p_fic`, commit 4bcee96 fixed that,
but also moved the NUL check into a grouped condition. The bug remained hidden
because there weren't any cases where strings had different lengths and c1 and
c2 could both reach NUL. `c:/foo` vs `/foo` happens to be such a case, which is
why the infinite loop finally showed up.
Solution:
Break the loop when either `c1` or `c2` is NUL.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions