diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-12 07:40:47 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-12 07:40:47 +0300 |
commit | b81a7b58875e07d7e82aafced1de9834ba1ef94a (patch) | |
tree | 47a7e33fdbd718fce1948183e1905a174c43fa40 /builtin-tag.c | |
parent | 5d921e2931e5041884d8f86fdccc9004a7b071cc (diff) | |
parent | ea14e6c55427f50f78fe47187cd4edb9845943a1 (diff) |
Merge branch 'maint'
* maint:
git-svn: fix find-rev error message when missing arg
t0021: tr portability fix for Solaris
launch_editor(): allow spaces in the filename
git rebase --abort: always restore the right commit
Diffstat (limited to 'builtin-tag.c')
-rw-r--r-- | builtin-tag.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin-tag.c b/builtin-tag.c index 28c36fdcd1..8dd959fe1c 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -50,12 +50,15 @@ void launch_editor(const char *path, struct strbuf *buffer, const char *const *e 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; @@ -63,6 +66,7 @@ void launch_editor(const char *path, struct strbuf *buffer, const char *const *e 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) |