summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4b46f9)
raw | patch | inline | side by side (parent: b4b46f9)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 26 Mar 2010 01:44:26 +0000 (21:44 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 29 Mar 2010 00:18:16 +0000 (20:18 -0400) |
tig.c | patch | blob | history |
index d2220c2e1ded37e067d3c6f1c4b04b7b1d82afef..589bc5329c4a0b99d1b93ce435d2a2c78a67b3be 100644 (file)
--- a/tig.c
+++ b/tig.c
static char opt_head_rev[SIZEOF_REV] = "";
static char opt_remote[SIZEOF_REF] = "";
static char opt_encoding[20] = "UTF-8";
-static char opt_codeset[20] = "UTF-8";
static iconv_t opt_iconv_in = ICONV_NONE;
static iconv_t opt_iconv_out = ICONV_NONE;
static char opt_search[SIZEOF_STR] = "";
int
main(int argc, const char *argv[])
{
+ const char *codeset = "UTF-8";
enum request request = parse_options(argc, argv);
struct view *view;
size_t i;
signal(SIGPIPE, SIG_IGN);
if (setlocale(LC_ALL, "")) {
- char *codeset = nl_langinfo(CODESET);
-
- string_ncopy(opt_codeset, codeset, strlen(codeset));
+ codeset = nl_langinfo(CODESET);
}
if (load_repo_info() == ERR)
if (!opt_git_dir[0] && request != REQ_VIEW_PAGER)
die("Not a git repository");
- if (*opt_encoding && strcmp(opt_codeset, "UTF-8")) {
+ if (*opt_encoding && strcmp(codeset, "UTF-8")) {
opt_iconv_in = iconv_open("UTF-8", opt_encoding);
if (opt_iconv_in == ICONV_NONE)
die("Failed to initialize character set conversion");
}
- if (*opt_codeset && strcmp(opt_codeset, "UTF-8")) {
- opt_iconv_out = iconv_open(opt_codeset, "UTF-8");
+ if (codeset && strcmp(codeset, "UTF-8")) {
+ opt_iconv_out = iconv_open(codeset, "UTF-8");
if (opt_iconv_out == ICONV_NONE)
die("Failed to initialize character set conversion");
}