diff options
Diffstat (limited to 'builtin/checkout-index.c')
-rw-r--r-- | builtin/checkout-index.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c index ed888a5b9e..d8d7bd3854 100644 --- a/builtin/checkout-index.c +++ b/builtin/checkout-index.c @@ -251,7 +251,8 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) } if (read_from_stdin) { - struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT; + struct strbuf buf = STRBUF_INIT; + struct strbuf unquoted = STRBUF_INIT; strbuf_getline_fn getline_fn; if (all) @@ -261,16 +262,16 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) while (getline_fn(&buf, stdin) != EOF) { char *p; if (!nul_term_line && buf.buf[0] == '"') { - strbuf_reset(&nbuf); - if (unquote_c_style(&nbuf, buf.buf, NULL)) + strbuf_reset(&unquoted); + if (unquote_c_style(&unquoted, buf.buf, NULL)) die("line is badly quoted"); - strbuf_swap(&buf, &nbuf); + strbuf_swap(&buf, &unquoted); } p = prefix_path(prefix, prefix_length, buf.buf); checkout_file(p, prefix); free(p); } - strbuf_release(&nbuf); + strbuf_release(&unquoted); strbuf_release(&buf); } |