[issue:445] *ptex --version should not require texmf.cnf
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 other engines don't look for texmf.cnf, so far as I know. It is better for those basic options to work without requiring texmf.cnf, or anything else, to be installed/findable, e.g., when running in the build directory. The result is the warning about "configuration file texmf.cnf not found". For example, cd .../Build/source/Work/texk/web2c ./ptex --version warning: kpathsea: configuration file texmf.cnf not found in these directories: [long long list omitted] .. pTeX 3.141592653-p4.0.0 (utf8.euc) (TeX Live 2023/dev) Compared with: $ ./tex --version TeX 3.141592653 (TeX Live 2023/dev) (that is, no warning is emitted) Thanks, Karl
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>