strbuf: implement strbuf_strip_suffix
commit6dda4e60f2c3c309de6e3fe1b86a47846a86dabf
authorJeff King <peff@peff.net>
Mon, 30 Jun 2014 17:01:51 +0000 (30 13:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Jun 2014 20:43:32 +0000 (30 13:43 -0700)
tree1e1ba2572a16b536e1f7f65130d907b9615b9258
parent592ce20820ac36dd868dfd1e61b1aeb3cd3f902a
strbuf: implement strbuf_strip_suffix

You can almost get away with just calling "strip_suffix_mem"
on a strbuf's buf and len fields. But we also need to move
the NUL-terminator to satisfy strbuf's invariants. Let's
provide a convenience wrapper that handles this.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf.h