Patch 8.0.1383
Problem: Local additions in help skips some files. (joshklod)
Solution: Check the base file name length equals.
Files: src/ex_cmds.c, src/testdir/test_help.vim
*** ../vim-8.0.1382/src/ex_cmds.c 2017-12-09 19:51:44.633128944 +0100
--- src/ex_cmds.c 2017-12-09 21:07:52.123536856 +0100
***************
*** 6934,6946 ****
&& 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;
/* If foo.abx is found use it instead of foo.txt in
* the same directory. */
--- 6934,6943 ----
&& fcount > 0)
{
#ifdef FEAT_MULTI_LANG
! 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,6964 ****
f1 = fnames[i1];
f2 = fnames[i2];
t1 = gettail(f1);
! if (fnamencmp(f1, f2, t1 - f1) != 0)
! continue;
e1 = vim_strrchr(t1, '.');
! e2 = vim_strrchr(gettail(f2), '.');
if (e1 == NULL || e2 == NULL)
continue;
if (fnamecmp(e1, ".txt") != 0
--- 6952,6960 ----
f1 = fnames[i1];
f2 = fnames[i2];
t1 = gettail(f1);
! t2 = gettail(f2);
e1 = vim_strrchr(t1, '.');
! e2 = vim_strrchr(t2, '.');
if (e1 == NULL || e2 == NULL)
continue;
if (fnamecmp(e1, ".txt") != 0
***************
*** 6969,6975 ****
fnames[i1] = NULL;
continue;
}
! if (fnamencmp(f1, f2, e1 - f1) != 0)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)
--- 6965,6972 ----
fnames[i1] = NULL;
continue;
}
! if (e1 - f1 != e2 - f2
! || fnamencmp(f1, f2, e1 - f1) != 0)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)
*** ../vim-8.0.1382/src/testdir/test_help.vim 2017-08-26 16:25:28.747075616
+0200
--- src/testdir/test_help.vim 2017-12-09 20:53:57.932461393 +0100
***************
*** 30,32 ****
--- 30,51 ----
close
bwipe!
endfunc
+
+ func Test_help_local_additions()
+ call mkdir('Xruntime/doc', 'p')
+ call writefile(['*mydoc.txt* my awesome doc'], 'Xruntime/doc/mydoc.txt')
+ call writefile(['*mydoc-ext.txt* my extended awesome doc'],
'Xruntime/doc/mydoc-ext.txt')
+ let rtp_save = &rtp
+ set rtp+=./Xruntime
+ help
+ 1
+ call search('mydoc.txt')
+ call assert_equal('|mydoc.txt| my awesome doc', getline('.'))
+ 1
+ call search('mydoc-ext.txt')
+ call assert_equal('|mydoc-ext.txt| my extended awesome doc', getline('.'))
+ close
+
+ call delete('Xruntime', 'rf')
+ let &rtp = rtp_save
+ endfunc
*** ../vim-8.0.1382/src/version.c 2017-12-09 19:51:44.637128920 +0100
--- src/version.c 2017-12-09 20:43:48.388267015 +0100
***************
*** 773,774 ****
--- 773,776 ----
{ /* Add new patch number below this line */
+ /**/
+ 1383,
/**/
--
>From "know your smileys":
=):-) Uncle Sam
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.