From: "Stephen Cuppett" <cuppett@gmail.com>
To: git@vger.kernel.org
Subject: Passing **envp around in git.c
Date: Mon, 11 Jun 2007 17:15:48 -0400 [thread overview]
Message-ID: <316a20a40706111415i3181df45oabd1564313eea3bc@mail.gmail.com> (raw)
Is there a reason for passing char** envp around in git.c or is it a
vestige of something older? It's sent into handle_internal_command
from main; however, it's never used. Looks like it might have been
used before, but then replaced with getenv. The code probably gets
optimized out at compile time, but to clean up:
diff --git a/git.c b/git.c
index 29b55a1..614baed 100644
--- a/git.c
+++ b/git.c
@@ -216,7 +216,7 @@ const char git_version_string[] = GIT_VERSION;
*/
#define NOT_BARE (1<<2)
-static void handle_internal_command(int argc, const char **argv, char **envp)
+static void handle_internal_command(int argc, const char **argv)
{
const char *cmd = argv[0];
static struct cmd_struct {
@@ -358,7 +358,7 @@ int main(int argc, const char **argv, char **envp)
if (!prefixcmp(cmd, "git-")) {
cmd += 4;
argv[0] = cmd;
- handle_internal_command(argc, argv, envp);
+ handle_internal_command(argc, argv);
die("cannot handle %s internally", cmd);
}
@@ -390,7 +390,7 @@ int main(int argc, const char **argv, char **envp)
while (1) {
/* See if it's an internal command */
- handle_internal_command(argc, argv, envp);
+ handle_internal_command(argc, argv);
/* .. then try the external ones */
execv_git_cmd(argv);
reply other threads:[~2007-06-11 21:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=316a20a40706111415i3181df45oabd1564313eea3bc@mail.gmail.com \
--to=cuppett@gmail.com \
--cc=git@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox