Rev 4281 | Rev 4490 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4281 | Rev 4312 | ||
---|---|---|---|
Line 639... | Line 639... | ||
639 | */ |
639 | */ |
640 | const char *str_chr(const char *str, wchar_t ch) |
640 | const char *str_chr(const char *str, wchar_t ch) |
641 | { |
641 | { |
642 | wchar_t acc; |
642 | wchar_t acc; |
643 | size_t off = 0; |
643 | size_t off = 0; |
- | 644 | size_t last = 0; |
|
644 | 645 | ||
645 | while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
646 | while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
646 | if (acc == ch) |
647 | if (acc == ch) |
647 | return (str + off); |
648 | return (str + last); |
- | 649 | last = off; |
|
648 | } |
650 | } |
649 | 651 | ||
650 | return NULL; |
652 | return NULL; |
651 | } |
653 | } |
652 | 654 |