[issue:446] Re: *ptex --version should not require texmf.cnf
Hironori KITAGAWA
h_kitagawa2001 @ yahoo.co.jp
2022年 8月 29日 (月) 13:42:32 JST
Hello Karl and all,
> Hi - as of perhaps a month or so ago (I believe), (e)(u)ptex has started
> looking for texmf.cnf when given --help and --version before giving the
> expected output.
The place where texmfcnf.cnf is looked for is
void init_default_kanji (const_string file_str, const_string internal_str)
{
...
p = kpse_var_value ("guess_input_kanji_encoding");
...
}
in kanji.c. It is executed (as initkanji()) from maininit().
It looks like "guess_input_kanji_encoding" information is not needed
before parse_options(). So one approach is:
maininit(){
char *p;
...
initkanji(); // move "guess_input_kanji_encoding" stuff from kanji.c ...
infile_enc_auto = 2; // "not set"
...
parse_options(...);
if (infile_enc_auto == 2) {
// ... to here.
p = kpse_var_value ("guess_input_kanji_encoding");
if (p) {
if (*p == '1' || *p == 'y' || *p == 't')
infile_enc_auto = 1;
free(p);
}
}
...
}
--
Hironori KITAGAWA <h_kitagawa2001 @ yahoo.co.jp>
issue メーリングリストの案内