Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rev-parse: read parseopt spec with strbuf_getline()
author
Junio C Hamano
<gitster@pobox.com>
Wed, 28 Oct 2015 20:59:44 +0000
(13:59 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 15 Jan 2016 18:34:41 +0000
(10:34 -0800)
"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>
builtin/rev-parse.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6e8d46f
)
diff --git
a/builtin/rev-parse.c
b/builtin/rev-parse.c
index 0324abb74972c48e585070ba19664a4eca45c244..bd16876df5ff7bce4fbf348d84a0ebc4ea53e7d7 100644
(file)
--- 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 (;;) {
/* 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)) {
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> */
}
/* 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;
const char *s;
const char *help;
struct option *o;