Browse Source

Merge branch 'rs/commit-export-env-simplify'

Code cleanup.

* rs/commit-export-env-simplify:
  commit: use strbuf_add() to add a length-limited string
maint
Junio C Hamano 5 years ago
parent
commit
e3b72391d1
  1. 2
      builtin/commit.c

2
builtin/commit.c

@ -554,7 +554,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack) @@ -554,7 +554,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
struct strbuf buf = STRBUF_INIT;
if (hack)
strbuf_addch(&buf, hack);
strbuf_addf(&buf, "%.*s", (int)(e - s), s);
strbuf_add(&buf, s, e - s);
setenv(var, buf.buf, 1);
strbuf_release(&buf);
}

Loading…
Cancel
Save