chiark / gitweb /
Oops, always ensure that ICONV_CONST is defined
authorJonas Fonseca <fonseca@diku.dk>
Fri, 14 Sep 2007 13:57:42 +0000 (15:57 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Fri, 14 Sep 2007 13:57:42 +0000 (15:57 +0200)
tig.c

diff --git a/tig.c b/tig.c
index 0390b3a00276a2ce4060daf9bd323aedd45e6f04..05ec10c7b407736d111be1e927fe6b182af74f6e 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -80,6 +80,9 @@ static size_t utf8_length(const char *string, size_t max_width, int *coloffset,
 #define COLOR_DEFAULT  (-1)
 
 #define ICONV_NONE     ((iconv_t) -1)
+#ifndef ICONV_CONST
+#define ICONV_CONST    /* nothing */
+#endif
 
 /* The format and size of the date column in the main view. */
 #define DATE_FORMAT    "%Y-%m-%d %H:%M"
@@ -4611,10 +4614,6 @@ main(int argc, char *argv[])
        if (load_repo_info() == ERR)
                die("Failed to load repo info.");
 
-       /* Require a git repository unless when running in pager mode. */
-       if (!opt_git_dir[0])
-               die("Not a git repository");
-
        if (load_options() == ERR)
                die("Failed to load user config.");
 
@@ -4626,6 +4625,10 @@ main(int argc, char *argv[])
        if (!parse_options(argc, argv))
                return 0;
 
+       /* Require a git repository unless when running in pager mode. */
+       if (!opt_git_dir[0])
+               die("Not a git repository");
+
        if (*opt_codeset && strcmp(opt_codeset, opt_encoding)) {
                opt_iconv = iconv_open(opt_codeset, opt_encoding);
                if (opt_iconv == ICONV_NONE)