static inline int special_char(unsigned char c1)
{
- return !c1 || c1 == '*' || c1 == '[' || c1 == '?';
+ return !c1 || c1 == '*' || c1 == '[' || c1 == '?' || c1 == '\\';
}
/*
int read_directory(struct dir_struct *dir, const char *path, const char *base, int baselen, const char **pathspec)
{
- struct path_simplify *simplify = create_simplify(pathspec);
+ struct path_simplify *simplify;
+ if (has_symlink_leading_path(strlen(path), path))
+ return dir->nr;
+
+ simplify = create_simplify(pathspec);
read_directory_recursive(dir, path, base, baselen, 0, simplify);
free_simplify(simplify);
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);