Changeset fb75979 in mainline for common/str.c


Ignore:
Timestamp:
2025-04-17T15:11:03Z (5 days ago)
Author:
GitHub <noreply@…>
Children:
a65ccc4
Parents:
1d3ae66 (diff), 45adeeb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-17 15:11:03)
git-committer:
GitHub <noreply@…> (2025-04-17 15:11:03)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/str.c

    r1d3ae66 rfb75979  
    427427        char32_t ch = _str_decode(str, offset, size, &mb);
    428428
    429         if (ch == CHAR_INVALID)
     429        if (ch == CHAR_INVALID || mb.state)
    430430                return U_SPECIAL;
    431431
    432         if (mb.state)
    433                 return U_SPECIAL;
    434 
    435432        return ch;
     433}
     434
     435char32_t str_decode_r(const char *str, size_t *offset, size_t size,
     436        char32_t replacement, mbstate_t *mb)
     437{
     438        char32_t ch = _str_decode(str, offset, size, mb);
     439        return (ch == CHAR_INVALID) ? replacement : ch;
    436440}
    437441
Note: See TracChangeset for help on using the changeset viewer.