From: Karl Williamson Date: Sun, 16 Oct 2011 18:43:54 +0000 (-0600) Subject: utf8.c: White space only X-Git-Tag: v5.15.4~24 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/1b4059d5cc56d776be91d8e68e5a22ebabf25d09 utf8.c: White space only Indent newly formed blocks, and reflow comments and code to fit in narrower space --- diff --git a/utf8.c b/utf8.c index 7001041..6307386 100644 --- a/utf8.c +++ b/utf8.c @@ -3444,45 +3444,48 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, register UV l1, bool u1 * handle locale rules */ } else { - if ((flags & FOLDEQ_UTF8_LOCALE) - && (! u1 || UTF8_IS_INVARIANT(*p1) || UTF8_IS_DOWNGRADEABLE_START(*p1))) - { - /* There is no mixing of code points above and below 255. */ - if (u2 && (! UTF8_IS_INVARIANT(*p2) - && ! UTF8_IS_DOWNGRADEABLE_START(*p2))) + if ((flags & FOLDEQ_UTF8_LOCALE) + && (! u1 || UTF8_IS_INVARIANT(*p1) + || UTF8_IS_DOWNGRADEABLE_START(*p1))) { - return 0; - } + /* There is no mixing of code points above and below 255. */ + if (u2 && (! UTF8_IS_INVARIANT(*p2) + && ! UTF8_IS_DOWNGRADEABLE_START(*p2))) + { + return 0; + } - /* We handle locale rules by converting, if necessary, the code - * point to a single byte. */ - if (! u1 || UTF8_IS_INVARIANT(*p1)) { - *foldbuf1 = *p1; + /* We handle locale rules by converting, if necessary, the + * code point to a single byte. */ + if (! u1 || UTF8_IS_INVARIANT(*p1)) { + *foldbuf1 = *p1; + } + else { + *foldbuf1 = TWO_BYTE_UTF8_TO_UNI(*p1, *(p1 + 1)); + } + n1 = 1; } - else { - *foldbuf1 = TWO_BYTE_UTF8_TO_UNI(*p1, *(p1 + 1)); + else if (isASCII(*p1)) { /* Note, that here won't be + both ASCII and using locale + rules */ + + /* If trying to mix non- with ASCII, and not supposed to, + * fail */ + if ((flags & FOLDEQ_UTF8_NOMIX_ASCII) && ! isASCII(*p2)) { + return 0; + } + n1 = 1; + *foldbuf1 = toLOWER(*p1); /* Folds in the ASCII range are + just lowercased */ } - n1 = 1; - } - else if (isASCII(*p1)) { /* Note, that here won't be both ASCII - and using locale rules */ - - /* If trying to mix non- with ASCII, and not supposed to, fail */ - if ((flags & FOLDEQ_UTF8_NOMIX_ASCII) && ! isASCII(*p2)) { - return 0; + else if (u1) { + to_utf8_fold(p1, foldbuf1, &n1); } - n1 = 1; - *foldbuf1 = toLOWER(*p1); /* Folds in the ASCII range are - just lowercased */ - } - else if (u1) { - to_utf8_fold(p1, foldbuf1, &n1); - } - else { /* Not utf8, convert to it first and then get fold */ - uvuni_to_utf8(natbuf, (UV) NATIVE_TO_UNI(((UV)*p1))); - to_utf8_fold(natbuf, foldbuf1, &n1); - } - f1 = foldbuf1; + else { /* Not utf8, convert to it first and then get fold */ + uvuni_to_utf8(natbuf, (UV) NATIVE_TO_UNI(((UV)*p1))); + to_utf8_fold(natbuf, foldbuf1, &n1); + } + f1 = foldbuf1; } }