Christ van Willegen wrote:
> On Tue, Aug 25, 2015 at 4:31 PM, Bram Moolenaar <[email protected]> wrote:
> > ***************
> > *** 5068,5086 ****
> > if (s1 == NULL || s2 == NULL)
> > return FALSE;
> >
> > ! if (STRLEN(s1) != STRLEN(s2))
> > ! return FAIL;
> > !
> > ! for (i = 0; s1[i] != NUL && s2[i] != NUL; i += MB_PTR2LEN(s1 + i))
> > {
> > int c1 = PTR2CHAR(s1 + i);
> > ! int c2 = PTR2CHAR(s2 + i);
> >
> > if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> > && (prev1 != '*' || prev2 != '*'))
> > return FAIL;
> > prev2 = prev1;
> > prev1 = c1;
> > }
> > return TRUE;
> > }
> > --- 5068,5086 ----
> > if (s1 == NULL || s2 == NULL)
> > return FALSE;
> >
> > ! for (i = 0, j = 0; s1[i] != NUL;)
> > {
> > int c1 = PTR2CHAR(s1 + i);
> > ! int c2 = PTR2CHAR(s2 + j);
> >
> > if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> > && (prev1 != '*' || prev2 != '*'))
> > return FAIL;
> > prev2 = prev1;
> > prev1 = c1;
> > +
> > + i += MB_PTR2LEN(s1 + i);
> > + j += MB_PTR2LEN(s2 + j);
> > }
> > return TRUE;
> > }
>
> Was the test for s2[j] != NUL left out intentionally, or does another
> code path catch that one?
There is a test for s1[i] != NUL. If s2[j] then is NUL the characters
differ, c1 and c2 differ, and it gets to "return FAIL".
--
Biting someone with your natural teeth is "simple assault," while biting
someone with your false teeth is "aggravated assault."
[real standing law in Louisana, United States of America]
/// 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.