From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Tue, 16 Apr 2013 15:30:09 +0100 Subject: [PATCH] Regression fix: Make section-from-path=-1 work again In-Reply-To: <1366121446-970028-1-git-send-email-plenz@cis.fu-berlin.de> References: <1366121446-970028-1-git-send-email-plenz@cis.fu-berlin.de> Message-ID: <20130416143008.GM2278@serenity.lan> 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?