diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-08 23:26:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-08 23:26:50 +0200 |
commit | b189295b72030f00c45c30d3daecf85d457221f8 (patch) | |
tree | 4d606bc64db62563d36e635dcdb33af616609220 /src/filepath.c | |
parent | 345f28df5482cd35f5fa74b06443376379f113b0 (diff) | |
download | vim-git-b189295b72030f00c45c30d3daecf85d457221f8.tar.gz |
patch 8.1.2125: fnamemodify() fails when repeating :ev8.1.2125
Problem: Fnamemodify() fails when repeating :e.
Solution: Do not go before the tail. (Rob Pilling, closes #5024)
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c index 3a06eec7b..cf401dc6d 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -563,7 +563,11 @@ repeat: } else // :r { - if (s > tail) // remove one extension + char_u *limit = *fnamep; + + if (limit < tail) + limit = tail; + if (s > limit) // remove one extension *fnamelen = (int)(s - *fnamep); } *usedlen += 2; |