Revised get_realpath for the case ./localfile.ext