diff options
Diffstat (limited to 'builtin-checkout-index.c')
-rw-r--r-- | builtin-checkout-index.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index 75377b9cab..a18ecc4bab 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -38,7 +38,6 @@ */ #include "builtin.h" #include "cache.h" -#include "strbuf.h" #include "quote.h" #include "cache-tree.h" @@ -274,13 +273,11 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) struct strbuf buf; if (all) die("git-checkout-index: don't mix '--all' and '--stdin'"); - strbuf_init(&buf); + strbuf_init(&buf, 0); while (1) { char *path_name; const char *p; - - read_line(&buf, stdin, line_termination); - if (buf.eof) + if (strbuf_getline(&buf, stdin, line_termination) == EOF) break; if (line_termination && buf.buf[0] == '"') path_name = unquote_c_style(buf.buf, NULL); @@ -293,6 +290,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) if (path_name != buf.buf) free(path_name); } + strbuf_release(&buf); } if (all) |