[Top][All Lists]

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

Re: [Bug-wget] Building and testing wget 1.16.1 on MinGW

From: Eli Zaretskii
Subject: Re: [Bug-wget] Building and testing wget 1.16.1 on MinGW
Date: Mon, 22 Dec 2014 18:09:06 +0200

> From: Tim Rühsen <address@hidden>
> Date: Sun, 21 Dec 2014 18:24:19 +0100
> > > +  exec_name = basename (argv[0]);
> > 
> > Shouldn't this use base_name?  AFAICS, this is what gnulib provides.
> base_name() is a similar function (but I couldn't find a documentation).
> https://www.gnu.org/software/gnulib/manual/html_node/basename.html
> The most important part seems to leave libgen.h away. To avoid the POSIX 
> basename function.

I'm sorry, but it looks like I'm still missing something.  AFAICS,
gnulib doesn't offer 'basename', it only offers 'base_name'.  I
verified this by running "nm -A" on libgnu.a.

The node you cite from the Gnulib manual says:

  Gnulib module: —

  Portability problems fixed by Gnulib:

  Portability problems not fixed by Gnulib:

      This function is missing on some platforms: IRIX 6.5, Solaris 2.5.1, 
mingw, MSVC 9, BeOS.
      glibc has two different functions basename: the POSIX version and the GNU 
      basename assumes file names in POSIX syntax; it does not work with file 
names in Windows syntax. 

  The Gnulib module dirname provides similar API, with function base_name, that 
also works with Windows file names.

My interpretation of this is:

  . Gnulib doesn't provide a substitute for this function (that's the
    "Gnulib module: —" part above, which is explained in the parent
    node).  It is also consistent with "Portability problems not fixed
    by Gnulib:"                                              ^^^^^^^^^

  . 'basename' as defined by Posix doesn't support Windows file names.

  . Gnulib provides a similar function called 'base_name' that does
    work on Posix and Windows platforms alike.

So it looks to me that my original comment was correct, and we should
call base_name.  What am I missing?

reply via email to

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