mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-17 04:23:29 -05:00
strbuf_readlink: support link targets that exceed PATH_MAX
strbuf_readlink() refuses to read link targets that exceed PATH_MAX (even if a sufficient size was specified by the caller). As some platforms support longer paths, remove this restriction (similar to strbuf_getcwd()). Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
committed by
Johannes Schindelin
parent
d283592c7e
commit
4981ee83e1
4
strbuf.c
4
strbuf.c
@@ -540,8 +540,6 @@ ssize_t strbuf_write(struct strbuf *sb, FILE *f)
|
||||
}
|
||||
|
||||
|
||||
#define STRBUF_MAXLINK (2*PATH_MAX)
|
||||
|
||||
int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
|
||||
{
|
||||
size_t oldalloc = sb->alloc;
|
||||
@@ -549,7 +547,7 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
|
||||
if (hint < 32)
|
||||
hint = 32;
|
||||
|
||||
while (hint < STRBUF_MAXLINK) {
|
||||
for (;;) {
|
||||
ssize_t len;
|
||||
|
||||
strbuf_grow(sb, hint + 1);
|
||||
|
||||
Reference in New Issue
Block a user