static const char * const git_tag_usage[] = {
"git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
"git-tag -d <tagname>...",
- "git-tag -l [-n [<num>]] [<pattern>]",
+ "git-tag -l [-n[<num>]] [<pattern>]",
"git-tag -v <tagname>...",
NULL
};
size_t len = strlen(editor);
int i = 0;
const char *args[6];
+ struct strbuf arg0;
+ strbuf_init(&arg0, 0);
if (strcspn(editor, "$ \t'") != len) {
/* there are specials */
+ strbuf_addf(&arg0, "%s \"$@\"", editor);
args[i++] = "sh";
args[i++] = "-c";
- args[i++] = "$0 \"$@\"";
+ args[i++] = arg0.buf;
}
args[i++] = editor;
args[i++] = path;
if (run_command_v_opt_cd_env(args, 0, NULL, env))
die("There was a problem with the editor %s.", editor);
+ strbuf_release(&arg0);
}
if (!buffer)