Re: over the maxfuncdepth (patch)
- Yasuhiro Matsumoto wrote:
> Hi vim-multibyte and bram.Aha, the mb_strnicmp() function didn't return -1, thus couldn't be used for
> a function of mb_strnicmp is not one of mbsnicmp.
> "eval.c" use negative value of STRICMP.
> a:line1 < a:line2
> a:line1 > a:line2
> eval.c (line 1554)
> this is a patch.
sorting. Thanks for figuring this out!
I think the handling of strings that differ in length isn't done right. See
the code below for what I made out of it.
> to bram -Well, I suppose it doesn't hurt to keep it in.
> I may that you return "vim.h" to original.
> (no problem and no slowdown)
mb_strnicmp(s1, s2, n)
char_u *s1, *s2;
int i, l;
for (i = 0; i < n; i += l)
l = (*mb_ptr2len_check)(s1 + i);
if (l <= 1)
/* Single byte: first check normally, then with ignore case. */
if (s1[i] != s2[i])
cdiff = TO_LOWER(s1[i]) - TO_LOWER(s2[i]);
if (cdiff != 0)
else if (s1[i] == NUL)
/* For multi-byte only ignore case for Unicode. */
if (l > n - i)
l = n - i;
cdiff = utf_fold(utf_ptr2char(s1 + i))
- utf_fold(utf_ptr2char(s2 + i));
cdiff = STRNCMP(s1 + i, s2 + i, l);
if (cdiff != 0)
TIM: Too late.
TIM: There he is!
[They all turn,, and see a large white RABBIT lollop a few yards out of the
cave. Accompanied by terrifying chord and jarring metallic monster noise.]
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///