[PATCH] Regression fix: Make section-from-path=-1 work again
John Keeping
john at keeping.me.uk
Tue Apr 16 16:30:09 CEST 2013
On Tue, Apr 16, 2013 at 04:10:46PM +0200, Julius Plenz wrote:
> This fixes a regression introduced in commit fb3655df, "use struct
> strbuf instead of static buffers":
>
> > The pattern there is to append the filename, use it and then reset
> > the buffer to its original length (retaining a trailing '/').
>
> This makes the "count slashes from end of string" fail. My workaround is
> to start counting only before the trailing slash.
This is the "rel" buffer, not "path" so I think it would be better to
just strip any trailing slash from "rel" when it is assigned. This has
the benefit of also making sure we don't have a trailing '/' in the
section name.
What do you think?
More information about the CGit
mailing list