git.el: Don't use --info-only when resolving a file.
[gitweb.git] / help.c
diff --git a/help.c b/help.c
index 7a7f7759e592208b4604b6987bce8be46c936882..341b9e370eec4fa90014249a63afac17b083b275 100644 (file)
--- a/help.c
+++ b/help.c
@@ -3,18 +3,17 @@
  *
  * Builtin help-related commands (help, usage, version)
  */
-#include <sys/ioctl.h>
 #include "cache.h"
 #include "builtin.h"
 #include "exec_cmd.h"
 #include "common-cmds.h"
-
+#include <sys/ioctl.h>
 
 /* most GUI terminals set COLUMNS (although some don't export it) */
 static int term_columns(void)
 {
        char *col_string = getenv("COLUMNS");
-       int n_cols = 0;
+       int n_cols;
 
        if (col_string && (n_cols = atoi(col_string)) > 0)
                return n_cols;
@@ -140,7 +139,7 @@ static void list_commands(const char *exec_path, const char *pattern)
                        continue;
 
                entlen = strlen(de->d_name);
-               if (has_extension(de->d_name, entlen, ".exe"))
+               if (has_extension(de->d_name, ".exe"))
                        entlen -= 4;
 
                if (longest < entlen)
@@ -184,7 +183,7 @@ static void show_man_page(const char *git_cmd)
                page = git_cmd;
        else {
                int page_len = strlen(git_cmd) + 4;
-               char *p = malloc(page_len + 1);
+               char *p = xmalloc(page_len + 1);
                strcpy(p, "git-");
                strcpy(p + 4, git_cmd);
                p[page_len] = 0;