From karl ¡÷ freefriends.org Mon Aug 29 07:51:24 2022 From: karl ¡÷ freefriends.org (Karl Berry) Date: Sun, 28 Aug 2022 16:51:24 -0600 Subject: [issue:445] *ptex --version should not require texmf.cnf Message-ID: 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 From h_kitagawa2001 ¡÷ yahoo.co.jp Mon Aug 29 13:42:32 2022 From: h_kitagawa2001 ¡÷ yahoo.co.jp (Hironori KITAGAWA) Date: Mon, 29 Aug 2022 13:42:32 +0900 Subject: [issue:446] Re: *ptex --version should not require texmf.cnf In-Reply-To: References: Message-ID: 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