diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-07-06 11:54:46 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-07-06 11:54:46 -0700 |
| commit | 67e7305e64fea8d15879e9dc3831fc8e31cfe619 (patch) | |
| tree | d8ed9ee0a2b54f3df4619af5757d938bb5247986 /builtin/stripspace.c | |
| parent | da269af9207e38e820daad8aa993caa7d2fad76c (diff) | |
| parent | 787cb8a48ae24ff07fa7c763909bb204bfdc84a7 (diff) | |
| download | git-67e7305e64fea8d15879e9dc3831fc8e31cfe619.tar.gz | |
Merge branch 'cw/strbuf-cleanup'
Move functions that are not about pure string manipulation out of
strbuf.[ch]
* cw/strbuf-cleanup:
strbuf: remove global variable
path: move related function to path
object-name: move related functions to object-name
credential-store: move related functions to credential-store file
abspath: move related functions to abspath
strbuf: clarify dependency
strbuf: clarify API boundary
Diffstat (limited to 'builtin/stripspace.c')
| -rw-r--r-- | builtin/stripspace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/stripspace.c b/builtin/stripspace.c index 397d7fe2dc..7b700a9fb1 100644 --- a/builtin/stripspace.c +++ b/builtin/stripspace.c @@ -1,5 +1,6 @@ #include "builtin.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "parse-options.h" #include "setup.h" @@ -12,7 +13,7 @@ static void comment_lines(struct strbuf *buf) size_t len; msg = strbuf_detach(buf, &len); - strbuf_add_commented_lines(buf, msg, len); + strbuf_add_commented_lines(buf, msg, len, comment_line_char); free(msg); } @@ -57,7 +58,8 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix) die_errno("could not read the input"); if (mode == STRIP_DEFAULT || mode == STRIP_COMMENTS) - strbuf_stripspace(&buf, mode == STRIP_COMMENTS); + strbuf_stripspace(&buf, + mode == STRIP_COMMENTS ? comment_line_char : '\0'); else comment_lines(&buf); |
