I'm adding this fix, and a test case.

2007-02-11  Bruno Haible  <[EMAIL PROTECTED]>

        * lib/mbschr.c (mbschr): Fix bug.

        * modules/mbschr-tests: New file.
        * tests/test-mbschr.sh: New file.
        * tests/test-mbschr.c: New file.
        * m4/locale-zh.m4: New file.

*** lib/mbschr.c        5 Feb 2007 01:01:37 -0000       1.1
--- lib/mbschr.c        11 Feb 2007 17:39:26 -0000
***************
*** 41,51 ****
  
        for (mbui_init (iter, string);; mbui_advance (iter))
        {
          if (mb_len (mbui_cur (iter)) == 1
              && (unsigned char) * mbui_cur_ptr (iter) == (unsigned char) c)
            break;
-         if (!mbui_avail (iter))
-           goto notfound;
        }
        return (char *) mbui_cur_ptr (iter);
       notfound:
--- 41,51 ----
  
        for (mbui_init (iter, string);; mbui_advance (iter))
        {
+         if (!mbui_avail (iter))
+           goto notfound;
          if (mb_len (mbui_cur (iter)) == 1
              && (unsigned char) * mbui_cur_ptr (iter) == (unsigned char) c)
            break;
        }
        return (char *) mbui_cur_ptr (iter);
       notfound:



Reply via email to