summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-12-09 21:10:13 +0100
committerBram Moolenaar <Bram@vim.org>2017-12-09 21:10:13 +0100
commit35c5e8155da797f14124d98fdc6189067b965688 (patch)
treea6c772ecc0bd5b4363e8f0ca3b663046662f434e /src/ex_cmds.c
parentf405c8fe85bba6dc96a68a12ab976f745fc51a38 (diff)
patch 8.0.1383: local additions in help skips some filesv8.0.1383
Problem: Local additions in help skips some files. (joshklod) Solution: Check the base file name length equals.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index cd8b0c3f57..91f5124de9 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6934,13 +6934,10 @@ fix_help_buffer(void)
&& fcount > 0)
{
#ifdef FEAT_MULTI_LANG
- int i1;
- int i2;
- char_u *f1;
- char_u *f2;
- char_u *t1;
- char_u *e1;
- char_u *e2;
+ int i1, i2;
+ char_u *f1, *f2;
+ char_u *t1, *t2;
+ char_u *e1, *e2;
/* If foo.abx is found use it instead of foo.txt in
* the same directory. */
@@ -6955,10 +6952,9 @@ fix_help_buffer(void)
f1 = fnames[i1];
f2 = fnames[i2];
t1 = gettail(f1);
- if (fnamencmp(f1, f2, t1 - f1) != 0)
- continue;
+ t2 = gettail(f2);
e1 = vim_strrchr(t1, '.');
- e2 = vim_strrchr(gettail(f2), '.');
+ e2 = vim_strrchr(t2, '.');
if (e1 == NULL || e2 == NULL)
continue;
if (fnamecmp(e1, ".txt") != 0
@@ -6969,7 +6965,8 @@ fix_help_buffer(void)
fnames[i1] = NULL;
continue;
}
- if (fnamencmp(f1, f2, e1 - f1) != 0)
+ if (e1 - f1 != e2 - f2
+ || fnamencmp(f1, f2, e1 - f1) != 0)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)