Replaced canonicalize_file_name() with realpath(path, NULL) which is not gnu extension