diff options
Diffstat (limited to 'ext/mbstring/oniguruma/enc/utf16_le.c')
-rwxr-xr-x | ext/mbstring/oniguruma/enc/utf16_le.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/mbstring/oniguruma/enc/utf16_le.c b/ext/mbstring/oniguruma/enc/utf16_le.c index db892dcd14..93cc6138a6 100755 --- a/ext/mbstring/oniguruma/enc/utf16_le.c +++ b/ext/mbstring/oniguruma/enc/utf16_le.c @@ -2,7 +2,7 @@ utf16_le.c - Oniguruma (regular expression library) **********************************************************************/ /*- - * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ #define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) #define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) -static int EncLen_UTF16[] = { +static const int EncLen_UTF16[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -69,6 +69,12 @@ utf16le_is_mbc_newline(const UChar* p, const UChar* end) if (p + 1 < end) { if (*p == 0x0a && *(p+1) == 0x00) return 1; +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if ((*p == 0x0d || *p == 0x85) && *(p+1) == 0x00) + return 1; + if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)) + return 1; +#endif } return 0; } |