On Montag, 12. September 2016 20:18:30 CEST Eli Zaretskii wrote:
> > From: Tim Ruehsen <[email protected]>
> > Date: Mon, 12 Sep 2016 13:00:32 +0200
> > 
> > > +  char *basename = name;
> > > +
> > > +  while ((name = strstr (basename, "/")))
> > > +    basename = name + 1;
> > 
> > Could you use strrchr() ? something like
> > 
> > char *basename = strrchr (name, '/');
> > 
> > if (basename)
> > 
> >   basename += 1;
> > 
> > else
> > 
> >   basename = name;
> 
> I think we want to use ISSEP, no?  Otherwise Windows file names with
> backslashes will misfire.

Good point. What about device names ?

So maybe base_name() from Gnulib module 'dirname' is the right choice !?
See https://www.gnu.org/software/gnulib/manual/html_node/basename.html

Regards, Tim

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to