mirror of
https://github.com/neovim/neovim.git
synced 2026-06-15 16:23:48 +00:00
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. Commite18a578accidentally used || before `(p_fic`, commit4bcee96fixed 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.