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>
Brandon Williams committed
Jan 9, 2017 at 10:50 UTC
7aeb81f1de6a06c7ebc9a881e3a07591d760c9d6
1 file changed
+3
-1
abspath.c
+3
-1
@@ -62,7 +62,9 @@ static void get_root_part(struct strbuf *resolved, struct strbuf *remaining)
62
}
63
64
/* We allow "recursive" symbolic links. Only within reason, though. */
65
-#define MAXSYMLINKS 5
65
+#ifndef MAXSYMLINKS
66
+#define MAXSYMLINKS 32
67
+#endif
68
69
/*
70
* Return the real path (i.e., absolute path, with symlinks resolved