Mercurial > hg > octave-nkf > gnulib-hg
changeset 8131:2c4153302289
Fix bug.
Add tests.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 11 Feb 2007 17:45:10 +0000 |
parents | 7929fe70db08 |
children | 95ebb0f8b658 |
files | ChangeLog lib/mbsrchr.c |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-02-11 Bruno Haible <bruno@clisp.org> + + * lib/mbsrchr.c (mbsrchr): Fix bug. + + * modules/mbsrchr-tests: New file. + * tests/test-mbsrchr.sh: New file. + * tests/test-mbsrchr.c: New file. + 2007-02-11 Bruno Haible <bruno@clisp.org> * lib/mbschr.c (mbschr): Fix bug.
--- a/lib/mbsrchr.c +++ b/lib/mbsrchr.c @@ -40,13 +40,11 @@ const char *result = NULL; mbui_iterator_t iter; - for (mbui_init (iter, string);; mbui_advance (iter)) + for (mbui_init (iter, string); mbui_avail (iter); mbui_advance (iter)) { if (mb_len (mbui_cur (iter)) == 1 && (unsigned char) * mbui_cur_ptr (iter) == (unsigned char) c) result = mbui_cur_ptr (iter); - if (!mbui_avail (iter)) - break; } return (char *) result; }