fix buf alias when parameter is a directory