Re: [PATCH 1/2] Introduce the function strip_path_suffix()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 18, 2009, 23:18 UTC
- Message-ID
- <alpine.DEB.1.00.0902190017460.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <499C8B44.1020106@kdbg.org>
Hi,
On Wed, 18 Feb 2009, Johannes Sixt wrote:
Show 15 quoted lines
> Johannes Schindelin schrieb:
> > On Wed, 18 Feb 2009, Johannes Sixt wrote:
> > > Johannes Schindelin schrieb:
> > > > strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
> > > > "libexec///git-core", &prefix)
> > > >
> > > > will set prefix to "C:\\msysgit" and return 0.
> > > But you implemented it so that prefix is actually "C:\\msysgit/\\"
> > > (unless, of course, I'm reading the code wrong).
> >
> > This is supposed to handle that case:
> >
> > *prefix = xstrndup(path, chomp_trailing_dir_sep(path, path_len));
>
> Ah, I missed that final call of chomp_trailing_dir_sep.I have to admit that I was aware of the fact that it is easy to miss, but could not find a better way to present it.
Ciao, Dscho