All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Paul Tan <pyokagan@gmail.com>
Subject: [PATCH 1/3] pager: lose a separate argv[]
Date: Tue, 16 Feb 2016 15:06:55 -0800	[thread overview]
Message-ID: <1455664017-27588-2-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1455664017-27588-1-git-send-email-gitster@pobox.com>

These days, using the embedded args array in the child_process
structure is the norm.  Follow that practice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 pager.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/pager.c b/pager.c
index 070dc11..5dbcc5a 100644
--- a/pager.c
+++ b/pager.c
@@ -11,7 +11,6 @@
  * something different on Windows.
  */
 
-static const char *pager_argv[] = { NULL, NULL };
 static struct child_process pager_process = CHILD_PROCESS_INIT;
 
 static void wait_for_pager(void)
@@ -70,9 +69,8 @@ void setup_pager(void)
 	setenv("GIT_PAGER_IN_USE", "true", 1);
 
 	/* spawn the pager */
-	pager_argv[0] = pager;
+	argv_array_push(&pager_process.args, pager);
 	pager_process.use_shell = 1;
-	pager_process.argv = pager_argv;
 	pager_process.in = -1;
 	if (!getenv("LESS"))
 		argv_array_push(&pager_process.env_array, "LESS=FRX");
-- 
2.7.1-460-gd45d0a4

  reply	other threads:[~2016-02-16 23:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 23:06 [PATCH 0/3] fix "v"iew subcommand in "git am -i" Junio C Hamano
2016-02-16 23:06 ` Junio C Hamano [this message]
2016-02-16 23:06 ` [PATCH 2/3] pager: factor out a helper to prepare a child process to run the pager Junio C Hamano
2016-02-16 23:26   ` Jeff King
2016-02-16 23:49     ` Junio C Hamano
2016-02-17  0:32       ` Jeff King
2016-02-16 23:06 ` [PATCH 3/3] am -i: fix "v"iew Junio C Hamano
2016-02-17 19:15 ` [PATCH v2 0/3] fix "v"iew subcommand in "git am -i" Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 1/3] pager: lose a separate argv[] Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 2/3] pager: factor out a helper to prepare a child process to run the pager Junio C Hamano
2016-02-17 19:15   ` [PATCH v2 3/3] am -i: fix "v"iew Junio C Hamano
2016-02-17 19:19   ` [PATCH v2 0/3] fix "v"iew subcommand in "git am -i" Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455664017-27588-2-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pyokagan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.