simple euristic for further free packing improvements
[gitweb.git] / exec_cmd.c
index 96cc2123b642173bbf7ff38cbea46695357b2c0b..44bb2f23de926db59832a69a3205a320dfe61c4d 100644 (file)
@@ -32,12 +32,12 @@ const char *git_exec_path(void)
 int execv_git_cmd(const char **argv)
 {
        char git_command[PATH_MAX + 1];
-       int len, err, i;
+       int len,  i;
        const char *paths[] = { current_exec_path,
                                getenv("GIT_EXEC_PATH"),
                                builtin_exec_path };
 
-       for (i = 0; i < sizeof(paths)/sizeof(paths[0]); ++i) {
+       for (i = 0; i < ARRAY_SIZE(paths); ++i) {
                const char *exec_dir = paths[i];
                const char *tmp;
 
@@ -85,8 +85,6 @@ int execv_git_cmd(const char **argv)
                /* execve() can only ever return if it fails */
                execve(git_command, (char **)argv, environ);
 
-               err = errno;
-
                argv[0] = tmp;
        }
        return -1;