Files
Fred WrightandChristopher Nielsen 46a3068583 realpath: Fix 10.6 non-POSIX version.
This adds our allocating wrapper to the 10.6 non-POSIX case, which
returns an unsafe buffer pointer when supplied with a nonexistent path
and no buffer.  Providing our own malloc()ed buffer avoids the
problem.  This only affects 32-bit builds, since 64-bit non-POSIX is
nonexistent.

The original flag is renamed in the process, with the original name
now reflecting the combined need for the wrapper.

Some whitespace cleanup is also applied to the other composite flag
definitions.

Updates README to reflect the fix.

TESTED:
Tests pass on all platforms, including newly added test case (next
commit).
2024-11-14 15:47:36 -05:00

26 lines
624 B
C

/*
* Version of test_realpath for compatibility entry.
*/
/*
* This tests the macports_legacy_realpath() compatibility entry.
*
* For OS versions that never used the wrapper, this entire test is a dummy.
* Because of that condition, this test is an exception to the rule that tests
* shouldn't check the feature flags.
*/
/* MP support header */
#include "MacportsLegacySupport.h"
#if __MPLS_LIB_SUPPORT_REALPATH_ALLOC__
#define TEST_MACPORTS_LEGACY_REALPATH
#include "test_realpath.c"
#else /* !__MPLS_LIB_SUPPORT_REALPATH_ALLOC__ */
int main(){ return 0; }
#endif /* !__MPLS_LIB_SUPPORT_REALPATH_ALLOC__ */