diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-01-13 18:32:23 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-15 10:23:57 -0800 |
commit | 1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2 (patch) | |
tree | fea2d4a8ae1b60e90034f2bc3e40ce09978c5a6c /builtin/am.c | |
parent | a392f57daf7dc5e72ab3ada7802eddc000fa3081 (diff) | |
download | git-1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2.tar.gz |
strbuf: give strbuf_getline() to the "most text friendly" variantjc/strbuf-getline
Now there is no direct caller to strbuf_getline(), we can demote it
to file-scope static that is private to strbuf.c and rename it to
strbuf_getdelim(). Rename strbuf_getline_crlf(), which is designed
to be the most "text friendly" variant, and allow it to take over
this simplest name, strbuf_getline(), so we can add more uses of it
without having to type _crlf over and over again in the coming
steps.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r-- | builtin/am.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/am.c b/builtin/am.c index 9063a4ac2c..7b8351dede 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -613,7 +613,7 @@ static int is_mail(FILE *fp) if (regcomp(®ex, header_regex, REG_NOSUB | REG_EXTENDED)) die("invalid pattern: %s", header_regex); - while (!strbuf_getline_crlf(&sb, fp)) { + while (!strbuf_getline(&sb, fp)) { if (!sb.len) break; /* End of header */ @@ -660,7 +660,7 @@ static int detect_patch_format(const char **paths) fp = xfopen(*paths, "r"); - while (!strbuf_getline_crlf(&l1, fp)) { + while (!strbuf_getline(&l1, fp)) { if (l1.len) break; } @@ -681,9 +681,9 @@ static int detect_patch_format(const char **paths) } strbuf_reset(&l2); - strbuf_getline_crlf(&l2, fp); + strbuf_getline(&l2, fp); strbuf_reset(&l3); - strbuf_getline_crlf(&l3, fp); + strbuf_getline(&l3, fp); /* * If the second line is empty and the third is a From, Author or Date |