diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-31 03:42:07 +0200 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-31 03:42:07 +0200 | 
| commit | 75ed3a79bf4fdcb71dd709495de544cb6cef17b3 (patch) | |
| tree | 67e4b404206c31d3d7d52673c12eb9f756db5c64 /src/utf16_le.c | |
| parent | c752981613de81bfa2723749b79e80bf0008f27c (diff) | |
| parent | a76fa337cc657dbe669ffb8dbdac606d4d6616f1 (diff) | |
Merge tag 'upstream/6.1.0'
Upstream version 6.1.0
Diffstat (limited to 'src/utf16_le.c')
| -rw-r--r-- | src/utf16_le.c | 18 | 
1 files changed, 17 insertions, 1 deletions
| diff --git a/src/utf16_le.c b/src/utf16_le.c index 2d9af52..89bc72f 100644 --- a/src/utf16_le.c +++ b/src/utf16_le.c @@ -61,6 +61,21 @@ utf16le_mbc_enc_len(const UChar* p)  }  static int +is_valid_mbc_string(const UChar* p, const UChar* end) +{ +  const UChar* end1 = end - 1; + +  while (p < end1) { +    p += utf16le_mbc_enc_len(p); +  } + +  if (p != end) +    return FALSE; +  else +    return TRUE; +} + +static int  utf16le_is_mbc_newline(const UChar* p, const UChar* end)  {    if (p + 1 < end) { @@ -225,5 +240,6 @@ OnigEncodingType OnigEncodingUTF16_LE = {    utf16le_left_adjust_char_head,    onigenc_always_false_is_allowed_reverse_match,    NULL, /* init */ -  NULL  /* is_initialized */ +  NULL, /* is_initialized */ +  is_valid_mbc_string  }; | 
