summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-01-09 10:50:23 -0800
committerJunio C Hamano <gitster@pobox.com>2017-01-09 11:25:57 -0800
commit7aeb81f1de6a06c7ebc9a881e3a07591d760c9d6 (patch)
tree2f725f557ec74962d95902fc2832eb6a0afe3c90 /abspath.c
parente9a379c352b02ca560c58a56aa723994aa42666f (diff)
downloadgit-7aeb81f1de6a06c7ebc9a881e3a07591d760c9d6.tar.gz
real_path: prevent redefinition of MAXSYMLINKS
The macro 'MAXSYMLINKS' is already defined on macOS and Linux in <sys/param.h>. If 'MAXSYMLINKS' has already been defined, use the value defined by the OS otherwise default to a value of 32 which is more inline with what is allowed by many systems. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/abspath.c b/abspath.c
index 1d56f5ed9f..0393213e5a 100644
--- a/abspath.c
+++ b/abspath.c
@@ -62,7 +62,9 @@ static void get_root_part(struct strbuf *resolved, struct strbuf *remaining)
}
/* We allow "recursive" symbolic links. Only within reason, though. */
-#define MAXSYMLINKS 5
+#ifndef MAXSYMLINKS
+#define MAXSYMLINKS 32
+#endif
/*
* Return the real path (i.e., absolute path, with symlinks resolved