Passing **envp around in git.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux