Skip to content

Commit

Permalink
Simplify test in re_string_skip_chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Jan 22, 2010
1 parent 4f08104 commit 5ddf954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2010-01-22 Ulrich Drepper <drepper@redhat.com>

* posix/regex_internal.c (re_string_skip_chars): Simplify test for
failed mbrtowc call.

2010-01-22 Jim Meyering <jim@meyering.net>

[BZ #11186]
Expand Down
2 changes: 1 addition & 1 deletion posix/regex_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
prev_st = pstr->cur_state;
mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
remain_len, &pstr->cur_state);
if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0))
if (BE ((ssize_t) mbclen <= 0, 0))
{
/* We treat these cases as a single byte character. */
if (mbclen == 0 || remain_len == 0)
Expand Down

0 comments on commit 5ddf954

Please sign in to comment.