use strrchr() over rindex() for portability