aboutsummaryrefslogtreecommitdiff
path: root/walker.c
diff options
context:
space:
mode:
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/walker.c b/walker.c
index 5c65ea494..397b80de9 100644
--- a/walker.c
+++ b/walker.c
@@ -6,7 +6,6 @@
#include "tag.h"
#include "blob.h"
#include "refs.h"
-#include "strbuf.h"
static unsigned char current_commit_sha1[20];
@@ -213,13 +212,12 @@ int walker_targets_stdin(char ***target, const char ***write_ref)
int targets = 0, targets_alloc = 0;
struct strbuf buf;
*target = NULL; *write_ref = NULL;
- strbuf_init(&buf);
+ strbuf_init(&buf, 0);
while (1) {
char *rf_one = NULL;
char *tg_one;
- read_line(&buf, stdin, '\n');
- if (buf.eof)
+ if (strbuf_getline(&buf, stdin, '\n') == EOF)
break;
tg_one = buf.buf;
rf_one = strchr(tg_one, '\t');
@@ -235,6 +233,7 @@ int walker_targets_stdin(char ***target, const char ***write_ref)
(*write_ref)[targets] = rf_one ? xstrdup(rf_one) : NULL;
targets++;
}
+ strbuf_release(&buf);
return targets;
}