X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=dir.c;h=92452eb5ef539336e41da0a717a7fc48d9554816;hb=8d13caf795902812d44809e2f222fb2334030603;hp=29d1d5ba31def46ba8b55905dc60773cc6cc167e;hpb=8366b7baae7e5a33f609b07c939a3571653a2314;p=git.git diff --git a/dir.c b/dir.c index 29d1d5ba3..92452eb5e 100644 --- a/dir.c +++ b/dir.c @@ -54,7 +54,7 @@ int common_prefix(const char **pathspec) static inline int special_char(unsigned char c1) { - return !c1 || c1 == '*' || c1 == '[' || c1 == '?'; + return !c1 || c1 == '*' || c1 == '[' || c1 == '?' || c1 == '\\'; } /* @@ -727,8 +727,12 @@ static void free_simplify(struct path_simplify *simplify) 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);