Use `MCStringLastIndexOfChar` instead, and call `setname(MCStringRef)` with the appropriate MCStringRef (either the whole string or the right part after `PATH_SEPARATOR`)