[PATCH] Check for existence of asprintf and vasprintf

Mike Frysinger vapier@gentoo.org
Fri Feb 24 19:15:00 GMT 2017

On 24 Feb 2017 10:42, Ulf Hermann wrote:
> >> and the GNU variant is a whopping two lines of code:
> >>
> >> char *base = strrchr(path, '/');
> >> return base ? base + 1 : (char *)path;
> >
> > and we get straight to an example of why your solutions don't scale.
> > your replacement is wrong.  and ironically, it's wrong on Windows,
> > which is the whole point of your work.  '/' is not the path sep used
> > on every system out there.  it also does not properly handle systems
> > (such as Windows) that have filesystem prefixes like C:\.
> Both basename variants' documentations only talk about '/'. This is not 
> the place where we should handle windows directory separators.

umm, sure it is.  if dirname/basename don't handle the OS separator, then
where do you think it should be handled ?  every place that calls basename ?

GNU/POSIX not talking about it isn't terribly relevant -- they don't care
about systems like Windows that have diff path name semantics.

although it's a moot point if you move everything to gnulib as they handle
the issue properly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/elfutils-devel/attachments/20170224/a8daa2af/attachment.sig>

More information about the Elfutils-devel mailing list