char *path_dup = xstrdup(path);
const char *base = basename(path_dup);
/* Generate "XXXXXX_basename.ext" */
char *path_dup = xstrdup(path);
const char *base = basename(path_dup);
/* Generate "XXXXXX_basename.ext" */
- strbuf_addstr(&template, "XXXXXX_");
- strbuf_addstr(&template, base);
+ strbuf_addstr(&tempfile, "XXXXXX_");
+ strbuf_addstr(&tempfile, base);
if (!temp->tempfile)
die_errno("unable to create temp-file");
if (convert_to_working_tree(path,
if (!temp->tempfile)
die_errno("unable to create temp-file");
if (convert_to_working_tree(path,
oid_to_hex_r(temp->hex, oid);
xsnprintf(temp->mode, sizeof(temp->mode), "%06o", mode);
strbuf_release(&buf);
oid_to_hex_r(temp->hex, oid);
xsnprintf(temp->mode, sizeof(temp->mode), "%06o", mode);
strbuf_release(&buf);