Re: [PATCH 1/3] Add strbuf_rtrim (to remove trailing spaces).
On Sat, Sep 08, 2007 at 10:53:53PM +0000, Pierre Habouzit wrote:
Show 26 quoted lines
> On sam, sep 08, 2007 at 04:18:20 +0000, René Scharfe wrote:
> > Pierre Habouzit schrieb:
> > > diff --git a/strbuf.c b/strbuf.c
> > > index acc7fc8..565c343 100644
> > > --- a/strbuf.c
> > > +++ b/strbuf.c
> > > @@ -28,6 +28,13 @@ void strbuf_grow(struct strbuf *sb, size_t extra) {
> > > ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc);
> > > }
> > >
> > > +void strbuf_rtrim(struct strbuf *sb)
> > > +{
> > > + while (sb->len > 0 && isspace((unsigned char)sb->buf[sb->len - 1]))
> > > + sb->len--;
> > > + sb->buf[sb->len] = '\0';
> > > +}
> >
> > Please use tabs instead of spaces to indent, just like you did in your
> > other patches. :)
>
> yeah, good catch.
> I've added some more patches tonight, and have added another function
> in strbufs, and thanks to the awsome git rebase -i, this patch
> integrates this new function as well, so this patch series is obsolete
> already. I wont repost it until I know if I should rebase it on next
> rather than master though. Okay I'm stupid, Junio already merged my patches in next, doh.
I've seen the conflict btw, and there is a memory leak (on the format)
in builtin-archive.c now... but I'm going to fix it (hopefuly) :)
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org