]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/mingw.c
use child_process member "args" instead of string array variable
[thirdparty/git.git] / compat / mingw.c
index 901375d58415a3ae21f03a15e7b78da6f8b08efa..d614f156df1db31248e3a1de51273ffefdd671ff 100644 (file)
@@ -196,16 +196,19 @@ static int read_yes_no_answer(void)
 static int ask_yes_no_if_possible(const char *format, ...)
 {
        char question[4096];
-       const char *retry_hook[] = { NULL, NULL, NULL };
+       const char *retry_hook;
        va_list args;
 
        va_start(args, format);
        vsnprintf(question, sizeof(question), format, args);
        va_end(args);
 
-       if ((retry_hook[0] = mingw_getenv("GIT_ASK_YESNO"))) {
-               retry_hook[1] = question;
-               return !run_command_v_opt(retry_hook, 0);
+       retry_hook = mingw_getenv("GIT_ASK_YESNO");
+       if (retry_hook) {
+               struct child_process cmd = CHILD_PROCESS_INIT;
+
+               strvec_pushl(&cmd.args, retry_hook, question, NULL);
+               return !run_command(&cmd);
        }
 
        if (!isatty(_fileno(stdin)) || !isatty(_fileno(stderr)))