bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {base,dir}name // semantics


From: Eric Blake
Subject: Re: {base,dir}name // semantics
Date: Sat, 09 Jul 2005 20:49:43 +0000

> address@hidden (Eric Blake) writes:
> 
> > should this patch be made globally, or should it be limited to only
> > systems that have a distinct //, leaving other platforms to continue
> > having just a single slash returned?
> 
> Limit it to just those systems, please.

I take it a simple autoconf test is in order (how about just testing
to see if 'ls -di / //' produces 2 different inodes?), and that the
results be used in the gnulib dirname module.

> 
> > I would argue that cross-platform consistency is more important
> 
> But that cuts both ways: Solaris "dirname //" outputs "/",
> and why should GNU/Linux dirname do anything differently?
> Let's not change this except on the poor platforms where leading // is
> special.

Why doesn't gnulib use the platform's basename(3) and dirname(3),
in <libgen.h>, if they are available?  Doing so would allow the
implementation to decide what behavior should be used.  For that
matter, it would fix cygwin's output, since cygwin's dirname(3) correctly
returns "//" for "//".

--
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]