summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-08 23:26:50 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-08 23:26:50 +0200
commitb189295b72030f00c45c30d3daecf85d457221f8 (patch)
tree4d606bc64db62563d36e635dcdb33af616609220 /src/filepath.c
parent345f28df5482cd35f5fa74b06443376379f113b0 (diff)
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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 3a06eec7b3..cf401dc6d5 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;