summaryrefslogtreecommitdiff
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-28 20:59:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-15 18:34:41 (GMT)
commit72e37b6ac851c3926956c9d11a40260f08bf1c5e (patch)
tree8d6ec50a72709902c2ebd050cd8afab0968718cf /builtin/rev-parse.c
parent6e8d46f9d4bb3643b8fdf4e1b0856f7910dbc948 (diff)
downloadgit-72e37b6ac851c3926956c9d11a40260f08bf1c5e.zip
git-72e37b6ac851c3926956c9d11a40260f08bf1c5e.tar.gz
git-72e37b6ac851c3926956c9d11a40260f08bf1c5e.tar.bz2
rev-parse: read parseopt spec with strbuf_getline()
"rev-parse --parseopt" specification is clearly text and we should anticipate that we may be fed CRLF lines. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r--builtin/rev-parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 0324abb..bd16876 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -383,7 +383,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
/* get the usage up to the first line with a -- on it */
for (;;) {
- if (strbuf_getline_lf(&sb, stdin) == EOF)
+ if (strbuf_getline(&sb, stdin) == EOF)
die("premature end of input");
ALLOC_GROW(usage, unb + 1, usz);
if (!strcmp("--", sb.buf)) {
@@ -396,7 +396,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
}
/* parse: (<short>|<short>,<long>|<long>)[*=?!]*<arghint>? SP+ <help> */
- while (strbuf_getline_lf(&sb, stdin) != EOF) {
+ while (strbuf_getline(&sb, stdin) != EOF) {
const char *s;
const char *help;
struct option *o;