diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-07 20:54:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-07 20:54:02 +0000 |
commit | cf48d248eb62e81239204ca4ca6b33029875e0bd (patch) | |
tree | e86de1646183d01ec3c8fb9a554a2bae476fd630 /util.c | |
parent | f7391caeba91da2f21fc9bf9ae8279f9173b8be6 (diff) | |
download | perl-cf48d248eb62e81239204ca4ca6b33029875e0bd.tar.gz |
Retract #14985, #14899, and #14990, following the principles
"Do no harm." and "If it ain't broke, don't fix it."
Firstly, the #14985 broke badly on UTF-EBCDIC, #14990 fixed
some, but still broken, and I do not have the extra brain
cells for the EBCDIC backport. Secondly, the old version
worked both in EBCDIC and non-. Thirdly, the old version
may be more amenable for the behaviour suggsted by Anton
Tagunov regarding the encoding pragma.
p4raw-id: //depot/perl@15084
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -4348,42 +4348,5 @@ Perl_sv_nounlocking(pTHX_ SV *sv) { } -/* -=for apidoc memcmp_byte_utf8 - -Similar to memcmp(), but the first string is with bytes, the second -with utf8. Takes into account that the lengths may be different. -=cut -*/ -int -Perl_memcmp_byte_utf8(pTHX_ char *sb, STRLEN lbyte, char *su, STRLEN lutf) -{ - U8 *sbyte = (U8*)sb; - U8 *sutf = (U8*)su; - U8 *ebyte = sbyte + lbyte; - U8 *eutf = sutf + lutf; - - while (sbyte < ebyte) { - if (sutf >= eutf) - return 1; /* utf one shorter */ - if (NATIVE_IS_INVARIANT(*sbyte)) { - if (*sbyte != *sutf) - return *sbyte - *sutf; - sbyte++; sutf++; /* CONTINUE */ - } else if ((*sutf & UTF_CONTINUATION_MASK) == - (*sbyte >> UTF_ACCUMULATION_SHIFT)) { - if ((sutf[1] & UTF_CONTINUATION_MASK) != - (*sbyte & UTF_CONTINUATION_MASK)) - return (*sbyte & UTF_CONTINUATION_MASK) - - (*sutf & UTF_CONTINUATION_MASK); - sbyte++, sutf += 2; /* CONTINUE */ - } else - return (*sbyte >> UTF_ACCUMULATION_SHIFT) - - (*sutf & UTF_CONTINUATION_MASK); - } - if (sutf >= eutf) - return 0; - return -1; /* byte one shorter */ -} |