On 7/19/2020 2:48 PM, Denys Vlasenko wrote: > strrchr(s,c) will first find the end of s, then go backwards looking for c. > The second part is wasted work, we only need to check the*last* char == c. Maybe a naive implementation, but why wouldn't they just record the last occurrence on a forward scan?