path: root/strbuf.h
diff options
authorTobias Klauser <>2015-10-16 15:16:42 (GMT)
committerJunio C Hamano <>2015-10-16 16:45:15 (GMT)
commit63af4a8446a624ad0d83d9b766c0eb5fbf83be12 (patch)
treec9be56334b556212b1e5ef0bb82b9b590e31d4a1 /strbuf.h
parent22f698cb188243b313e024d618283e0293e37140 (diff)
strbuf: make stripspace() part of strbuf
This function is also used in other builtins than stripspace, so it makes sense to have it in a more generic place. Since it operates on an strbuf and the function is declared in strbuf.h, move it to strbuf.c and add the corresponding prefix to its name, just like other API functions in the strbuf_* family. Also switch all current users of stripspace() to the new function name and keep a temporary wrapper inline function for any topic branches still using stripspace(). Reviewed-by: Matthieu Moy <> Signed-off-by: Tobias Klauser <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'strbuf.h')
1 files changed, 10 insertions, 1 deletions
diff --git a/strbuf.h b/strbuf.h
index aef2794..5397d91 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -418,7 +418,16 @@ extern void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
* Strip whitespace from a buffer. The second parameter controls if
* comments are considered contents to be removed or not.
-extern void stripspace(struct strbuf *buf, int skip_comments);
+extern void strbuf_stripspace(struct strbuf *buf, int skip_comments);
+ * Temporary alias until all topic branches have switched to use
+ * strbuf_stripspace directly.
+ */
+static inline void stripspace(struct strbuf *buf, int skip_comments)
+ strbuf_stripspace(buf, skip_comments);
static inline int strbuf_strip_suffix(struct strbuf *sb, const char *suffix)