There's a reference to MCS_resolvepath in this function... I suggest updating that to use the MCStringRef version (so t_sound_path is an MCStringRef), this then cleans up handling of t_sound_path as it stands now, and means you don't have to make a stringref from a c-string.