]> git.ipfire.org Git - thirdparty/git.git/blobdiff - editor.c
run-command API users: use strvec_pushl(), not argv construction
[thirdparty/git.git] / editor.c
index fdd3eeafa94791791aefc976988f4cd0b5a5f58f..d92a8d9ab5bb4f48d2eff713464f1da744ce50b1 100644 (file)
--- a/editor.c
+++ b/editor.c
@@ -55,7 +55,6 @@ static int launch_specified_editor(const char *editor, const char *path,
 
        if (strcmp(editor, ":")) {
                struct strbuf realpath = STRBUF_INIT;
-               const char *args[] = { editor, NULL, NULL };
                struct child_process p = CHILD_PROCESS_INIT;
                int ret, sig;
                int print_waiting_for_editor = advice_enabled(ADVICE_WAITING_FOR_EDITOR) && isatty(2);
@@ -77,9 +76,8 @@ static int launch_specified_editor(const char *editor, const char *path,
                }
 
                strbuf_realpath(&realpath, path, 1);
-               args[1] = realpath.buf;
 
-               p.argv = args;
+               strvec_pushl(&p.args, editor, realpath.buf, NULL);
                p.env = env;
                p.use_shell = 1;
                p.trace2_child_class = "editor";