Skip to content

Commit 41f0299

Browse files
kbleesdscho
authored andcommitted
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 <[email protected]>
1 parent dc0cc6a commit 41f0299

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

strbuf.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,16 +519,14 @@ ssize_t strbuf_write(struct strbuf *sb, FILE *f)
519519
}
520520

521521

522-
#define STRBUF_MAXLINK (2*PATH_MAX)
523-
524522
int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
525523
{
526524
size_t oldalloc = sb->alloc;
527525

528526
if (hint < 32)
529527
hint = 32;
530528

531-
while (hint < STRBUF_MAXLINK) {
529+
for (;;) {
532530
ssize_t len;
533531

534532
strbuf_grow(sb, hint + 1);

0 commit comments

Comments
 (0)