Code

Move unrelated UTF-8 setup code out of parse_options
authorJonas Fonseca <fonseca@diku.dk>
Thu, 20 Mar 2008 18:27:44 +0000 (19:27 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 20 Mar 2008 18:27:44 +0000 (19:27 +0100)
tig.c

diff --git a/tig.c b/tig.c
index b3a4e8d60819077c8683233a483a887168795498..36f03c2a4cd9a2823da14e38bba88d1550a59bed 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -605,9 +605,6 @@ parse_options(int argc, char *argv[])
                opt_cmd[buf_size] = 0;
        }
 
-       if (*opt_encoding && strcasecmp(opt_encoding, "UTF-8"))
-               opt_utf8 = FALSE;
-
        return TRUE;
 }
 
@@ -5148,6 +5145,9 @@ main(int argc, char *argv[])
        if (!opt_git_dir[0])
                die("Not a git repository");
 
+       if (*opt_encoding && strcasecmp(opt_encoding, "UTF-8"))
+               opt_utf8 = FALSE;
+
        if (*opt_codeset && strcmp(opt_codeset, opt_encoding)) {
                opt_iconv = iconv_open(opt_codeset, opt_encoding);
                if (opt_iconv == ICONV_NONE)