comparison src/help.c @ 26927:e3f3108a780a v8.2.3992

patch 8.2.3992: wrong local-additions in the help with language mix Commit: https://github.com/vim/vim/commit/0e2508d9e63e63414de2c06b3c8a446fdfe4470b Author: h-east <h.east.727@gmail.com> Date: Mon Jan 3 12:53:24 2022 +0000 patch 8.2.3992: wrong local-additions in the help with language mix Problem: Wrong local-additions in the help with language mix. Solution: Adjust how the local additions list is generated. (Hirohito Higashi, closes #9464)
author Bram Moolenaar <Bram@vim.org>
date Mon, 03 Jan 2022 14:00:04 +0100
parents 3631d2deb36c
children 61f686b38df9
comparison
equal deleted inserted replaced
26926:115ef4cd44b9 26927:e3f3108a780a
816 816
817 // If foo.abx is found use it instead of foo.txt in 817 // If foo.abx is found use it instead of foo.txt in
818 // the same directory. 818 // the same directory.
819 for (i1 = 0; i1 < fcount; ++i1) 819 for (i1 = 0; i1 < fcount; ++i1)
820 { 820 {
821 for (i2 = 0; i2 < fcount; ++i2) 821 f1 = fnames[i1];
822 t1 = gettail(f1);
823 e1 = vim_strrchr(t1, '.');
824 if (fnamecmp(e1, ".txt") != 0
825 && fnamecmp(e1, fname + 4) != 0)
822 { 826 {
823 if (i1 == i2) 827 // Not .txt and not .abx, remove it.
828 VIM_CLEAR(fnames[i1]);
829 continue;
830 }
831
832 for (i2 = i1 + 1; i2 < fcount; ++i2)
833 {
834 f2 = fnames[i2];
835 if (f2 == NULL)
824 continue; 836 continue;
825 if (fnames[i1] == NULL || fnames[i2] == NULL)
826 continue;
827 f1 = fnames[i1];
828 f2 = fnames[i2];
829 t1 = gettail(f1);
830 t2 = gettail(f2); 837 t2 = gettail(f2);
831 e1 = vim_strrchr(t1, '.');
832 e2 = vim_strrchr(t2, '.'); 838 e2 = vim_strrchr(t2, '.');
833 if (e1 == NULL || e2 == NULL) 839 if (e1 == NULL || e2 == NULL)
834 continue; 840 continue;
835 if (fnamecmp(e1, ".txt") != 0
836 && fnamecmp(e1, fname + 4) != 0)
837 {
838 // Not .txt and not .abx, remove it.
839 VIM_CLEAR(fnames[i1]);
840 continue;
841 }
842 if (e1 - f1 != e2 - f2 841 if (e1 - f1 != e2 - f2
843 || fnamencmp(f1, f2, e1 - f1) != 0) 842 || fnamencmp(f1, f2, e1 - f1) != 0)
844 continue; 843 continue;
845 if (fnamecmp(e1, ".txt") == 0 844 if (fnamecmp(e1, ".txt") == 0
846 && fnamecmp(e2, fname + 4) == 0) 845 && fnamecmp(e2, fname + 4) == 0)
847 // use .abx instead of .txt 846 // use .abx instead of .txt
848 VIM_CLEAR(fnames[i1]); 847 VIM_CLEAR(fnames[i1]);
849 } 848 }
850 } 849 }
851 #endif 850 #endif