diff options
author | Karsten Blees <karsten.blees@gmail.com> | 2014-07-05 00:41:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-07 11:22:42 -0700 |
commit | e7c730530065fb2f366ecbcb1e71d7f7346b6a25 (patch) | |
tree | cd6299bca9a68f2df452643eb878ba0cd2bf275f /cache.h | |
parent | c2f7b1026e33e308782fcb1b60e3d7af107fdc18 (diff) | |
download | git-e7c730530065fb2f366ecbcb1e71d7f7346b6a25.tar.gz |
symlinks: remove PATH_MAX limitation
'git checkout' fails if a directory is longer than PATH_MAX, because the
lstat_cache in symlinks.c checks if the leading directory exists using
PATH_MAX-bounded string operations.
Remove the limitation by using strbuf instead.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1068,12 +1068,16 @@ struct checkout { extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath); struct cache_def { - char path[PATH_MAX + 1]; - int len; + struct strbuf path; int flags; int track_flags; int prefix_len_stat_func; }; +#define CACHE_DEF_INIT { STRBUF_INIT, 0, 0, 0 } +static inline void cache_def_free(struct cache_def *cache) +{ + strbuf_release(&cache->path); +} extern int has_symlink_leading_path(const char *name, int len); extern int threaded_has_symlink_leading_path(struct cache_def *, const char *, int); |