mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
commit a0134ccf979154d120c01c95f477bd1b351c4bf3
|
|
Author: Thomas BERNARD <miniupnp@free.fr>
|
|
Date: Sun Feb 9 20:37:22 2020 +0100
|
|
|
|
realpath() don't accept NULL 2nd arg with OS X < 10.6
|
|
|
|
diff --git a/src/realpath.c b/src/realpath.c
|
|
index 256ad6ca..2c3e4165 100644
|
|
--- a/src/realpath.c
|
|
+++ b/src/realpath.c
|
|
@@ -11,6 +11,10 @@
|
|
#include <limits.h>
|
|
#endif
|
|
|
|
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
|
|
+#include "gfx2mem.h"
|
|
+#endif
|
|
+
|
|
#if defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__) || defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__) || defined(__amigaos__) || defined(__SWITCH__)
|
|
// These platforms don't have realpath().
|
|
// We use the following implementation, found in:
|
|
@@ -135,6 +139,15 @@
|
|
/// So we assume all platforms now support passing NULL.
|
|
/// If you find a platform where this is not the case,
|
|
/// please add a new implementation with ifdef's.
|
|
+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
|
|
+ // realpath() accept NULL as 2nd argument since OSX 10.6
|
|
+ if (resolved_path == NULL)
|
|
+ {
|
|
+ resolved_path = GFX2_malloc(PATH_MAX);
|
|
+ if (resolved_path == NULL)
|
|
+ return NULL;
|
|
+ }
|
|
+#endif
|
|
return realpath(_path, resolved_path);
|
|
}
|
|
#endif
|