From: Jonas Fonseca Date: Fri, 14 Sep 2007 13:57:42 +0000 (+0200) Subject: Oops, always ensure that ICONV_CONST is defined X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=58a5e4eadff325af1edff4144e2746133faf6fd0;hp=e47afdf2f78acbcb5c08f422be5ce37e0e99a5fc;p=tig.git Oops, always ensure that ICONV_CONST is defined --- diff --git a/tig.c b/tig.c index 0390b3a..05ec10c 100644 --- 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)