fix get_real_path (close #2251, close #1932)