[Rpm-maint] The usage of basename()

Panu Matilainen pmatilai at laiskiainen.org
Mon Aug 19 11:59:37 UTC 2013


On 08/18/2013 06:19 PM, Kamil Rytarowski wrote:
> Hello,
>
> There are two main implementations of basename() in the GNU system,
> one is libgen.h and one from string.h (being accessible here as
> _GNU_SOURCE). Currently we do not support systems other than with GNU
> Lib C (except possible compatibility layers), because we assume the
> basename() is shipped with string.h.
>
> There is a fundamental question before adding a header of libgen.h:
> the POSIX standard explicitly allows to modify the input -- is it
> acceptable?
>
> Should be there a rewriten a xbasename() version of this function to
> make sure it's portable across systems?

AFAICS based on a quick look, all the basename() callers in rpm 
explicitly assume the input may be modified so simply including libgen.h 
where necessary should be ok.

	- Panu -



More information about the Rpm-maint mailing list