gitweb: Convert generated contents to utf8 in commitdiff_plain
[gitweb.git] / var.c
diff --git a/var.c b/var.c
index a57a33b81ac6c9cb5ec0c833edc21bd66428d976..0de0efa2aa3b216a0bc846135a54ed0dd0549f8b 100644 (file)
--- a/var.c
+++ b/var.c
@@ -4,9 +4,6 @@
  * Copyright (C) Eric Biederman, 2005
  */
 #include "cache.h"
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
 
 static const char var_usage[] = "git-var [-l | <variable>]";
 
@@ -24,7 +21,7 @@ static void list_vars(void)
 {
        struct git_var *ptr;
        for(ptr = git_vars; ptr->read; ptr++) {
-               printf("%s=%s\n", ptr->name, ptr->read(0));
+               printf("%s=%s\n", ptr->name, ptr->read(IDENT_WARN_ON_NO_NAME));
        }
 }
 
@@ -35,7 +32,7 @@ static const char *read_var(const char *var)
        val = NULL;
        for(ptr = git_vars; ptr->read; ptr++) {
                if (strcmp(var, ptr->name) == 0) {
-                       val = ptr->read(1);
+                       val = ptr->read(IDENT_ERROR_ON_NO_NAME);
                        break;
                }
        }
@@ -59,7 +56,6 @@ int main(int argc, char **argv)
        }
 
        setup_git_directory();
-       setup_ident();
        val = NULL;
 
        if (strcmp(argv[1], "-l") == 0) {
@@ -71,8 +67,8 @@ int main(int argc, char **argv)
        val = read_var(argv[1]);
        if (!val)
                usage(var_usage);
-       
+
        printf("%s\n", val);
-       
+
        return 0;
 }