Mercurial > vim
comparison src/ex_cmds.c @ 13014:e1deb00ffc27 v8.0.1383
patch 8.0.1383: local additions in help skips some files
commit https://github.com/vim/vim/commit/35c5e8155da797f14124d98fdc6189067b965688
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 9 21:10:13 2017 +0100
patch 8.0.1383: local additions in help skips some files
Problem: Local additions in help skips some files. (joshklod)
Solution: Check the base file name length equals.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 09 Dec 2017 21:15:04 +0100 |
parents | 8d5b451d7bab |
children | 1bf3519889d3 |
comparison
equal
deleted
inserted
replaced
13013:f8a89f409dd7 | 13014:e1deb00ffc27 |
---|---|
6932 if (gen_expand_wildcards(1, &NameBuff, &fcount, | 6932 if (gen_expand_wildcards(1, &NameBuff, &fcount, |
6933 &fnames, EW_FILE|EW_SILENT) == OK | 6933 &fnames, EW_FILE|EW_SILENT) == OK |
6934 && fcount > 0) | 6934 && fcount > 0) |
6935 { | 6935 { |
6936 #ifdef FEAT_MULTI_LANG | 6936 #ifdef FEAT_MULTI_LANG |
6937 int i1; | 6937 int i1, i2; |
6938 int i2; | 6938 char_u *f1, *f2; |
6939 char_u *f1; | 6939 char_u *t1, *t2; |
6940 char_u *f2; | 6940 char_u *e1, *e2; |
6941 char_u *t1; | |
6942 char_u *e1; | |
6943 char_u *e2; | |
6944 | 6941 |
6945 /* If foo.abx is found use it instead of foo.txt in | 6942 /* If foo.abx is found use it instead of foo.txt in |
6946 * the same directory. */ | 6943 * the same directory. */ |
6947 for (i1 = 0; i1 < fcount; ++i1) | 6944 for (i1 = 0; i1 < fcount; ++i1) |
6948 { | 6945 { |
6953 if (fnames[i1] == NULL || fnames[i2] == NULL) | 6950 if (fnames[i1] == NULL || fnames[i2] == NULL) |
6954 continue; | 6951 continue; |
6955 f1 = fnames[i1]; | 6952 f1 = fnames[i1]; |
6956 f2 = fnames[i2]; | 6953 f2 = fnames[i2]; |
6957 t1 = gettail(f1); | 6954 t1 = gettail(f1); |
6958 if (fnamencmp(f1, f2, t1 - f1) != 0) | 6955 t2 = gettail(f2); |
6959 continue; | |
6960 e1 = vim_strrchr(t1, '.'); | 6956 e1 = vim_strrchr(t1, '.'); |
6961 e2 = vim_strrchr(gettail(f2), '.'); | 6957 e2 = vim_strrchr(t2, '.'); |
6962 if (e1 == NULL || e2 == NULL) | 6958 if (e1 == NULL || e2 == NULL) |
6963 continue; | 6959 continue; |
6964 if (fnamecmp(e1, ".txt") != 0 | 6960 if (fnamecmp(e1, ".txt") != 0 |
6965 && fnamecmp(e1, fname + 4) != 0) | 6961 && fnamecmp(e1, fname + 4) != 0) |
6966 { | 6962 { |
6967 /* Not .txt and not .abx, remove it. */ | 6963 /* Not .txt and not .abx, remove it. */ |
6968 vim_free(fnames[i1]); | 6964 vim_free(fnames[i1]); |
6969 fnames[i1] = NULL; | 6965 fnames[i1] = NULL; |
6970 continue; | 6966 continue; |
6971 } | 6967 } |
6972 if (fnamencmp(f1, f2, e1 - f1) != 0) | 6968 if (e1 - f1 != e2 - f2 |
6969 || fnamencmp(f1, f2, e1 - f1) != 0) | |
6973 continue; | 6970 continue; |
6974 if (fnamecmp(e1, ".txt") == 0 | 6971 if (fnamecmp(e1, ".txt") == 0 |
6975 && fnamecmp(e2, fname + 4) == 0) | 6972 && fnamecmp(e2, fname + 4) == 0) |
6976 { | 6973 { |
6977 /* use .abx instead of .txt */ | 6974 /* use .abx instead of .txt */ |