/* match empty string always works; happens when "~" is
* empty. */
}
- else if (opnd[1] == NUL
+ else
+ {
+ if (opnd[1] == NUL
#ifdef FEAT_MBYTE
&& !(enc_utf8 && ireg_ic)
#endif
)
- ++reginput; /* matched a single char */
- else
- {
- len = (int)STRLEN(opnd);
- /* Need to match first byte again for multi-byte. */
- if (cstrncmp(opnd, reginput, &len) != 0)
- status = RA_NOMATCH;
+ {
+ len = 1; /* matched a single byte above */
+ }
+ else
+ {
+ /* Need to match first byte again for multi-byte. */
+ len = (int)STRLEN(opnd);
+ if (cstrncmp(opnd, reginput, &len) != 0)
+ status = RA_NOMATCH;
+ }
#ifdef FEAT_MBYTE
/* Check for following composing character. */
- else if (enc_utf8
- && UTF_COMPOSINGLIKE(reginput, reginput + len))
+ if (status != RA_NOMATCH
+ && enc_utf8
+ && UTF_COMPOSINGLIKE(reginput, reginput + len)
+ && !ireg_icombine)
{
/* raaron: This code makes a composing character get
* ignored, which is the correct behavior (sometimes)
* for voweled Hebrew texts. */
- if (!ireg_icombine)
- status = RA_NOMATCH;
+ status = RA_NOMATCH;
}
#endif
- else
+ if (status != RA_NOMATCH)
reginput += len;
}
}
:call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
:call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
+:call add(tl, [2, "a", "ca\u0300t"])
+:call add(tl, [2, "a\u0300", "ca\u0300t", "a\u0300"])
:"""" Test \Z