Rev 4581 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4581 | Rev 4718 | ||
---|---|---|---|
Line 635... | Line 635... | ||
635 | * @param ch Character to look for. |
635 | * @param ch Character to look for. |
636 | * |
636 | * |
637 | * @return Pointer to character in @a str or NULL if not found. |
637 | * @return Pointer to character in @a str or NULL if not found. |
638 | * |
638 | * |
639 | */ |
639 | */ |
640 | const char *str_chr(const char *str, wchar_t ch) |
640 | 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 | size_t last = 0; |
645 | 645 | ||
646 | while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
646 | while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
647 | if (acc == ch) |
647 | if (acc == ch) |
648 | return (str + last); |
648 | return (char *) (str + last); |
649 | last = off; |
649 | last = off; |
650 | } |
650 | } |
651 | 651 | ||
652 | return NULL; |
652 | return NULL; |
653 | } |
653 | } |