Handle basename() variations
FreeBSD basename()
modifies the source string passed to it; this is explicitly allowed by the POSIX standard, and the Linux (GNU libc) manpages document this possible behavior of basename()
as well. This means that basename(__FILE__)
may be ill-formed (because __FILE__
may be const, and/or string literals const).
The FreeBSD packaging has a patch introducing an extra strdup()
, for the case where basename()
modifies the source.
-
Add CMake check for basename behavior -
Add patch to freeDiameter depending on basename behavior
(Although it may be sufficient to just approach this differently and not apply basename()
directly to a string literal.