I was testing multi-byte enhancements to coreutils/join with:
LC_ALL=en_US.utf8 join -i <(env printf '1\x00\n') <(env printf '2\x00\n')
and noticed it spun the CPU because of the NUL char.
The attached fixes the issue for me. This function is supposed
to skip over NUL chars like this right?

cheers,
Pádraig.

--- a/lib/mbmemcasecoll.c       2010-01-04 01:10:30.000000000 +0000
+++ b/lib/mbmemcasecoll.c       2010-09-21 23:52:23.000000000 +0000
@@ -61,6 +63,8 @@
         break;
       if (n1 != (size_t)(-1))
         {
+          if (n1 == 0)
+            n1 = 1; /* copy NUL characters.  */
           wint_t wc2 = towlower (wc1);

           if (wc2 != wc1)

Reply via email to