From 20a403c668123fd040d0a4c3564529faea2f0cd6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 17 Dec 2018 18:27:08 +0000 Subject: default preloaded guess to explicit &dumpname if given (from IgorL) git-svn-id: svn://tug.org/texlive/trunk@49433 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/ChangeLog | 7 +++++++ Build/source/texk/web2c/lib/texmfmp.c | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'Build/source/texk/web2c/lib') diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 66a33f23c4d..1e7b8fe97ba 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,10 @@ +2018-12-17 Igor Liferenko + + * texmfmp.c (maininit): default to guessing an explicit &dumpname + as the "preloaded" (not really) format, if one was specified. + tex-k msgs of 23 Sep 2018 12:13:06, 23 Sep 2018 18:36:52. + (With comment and formatting tinkering from karl.) + 2018-12-17 Andreas Scherer * printversion.c (printversionandexit): Search for PROGNAME diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 329a3f9222d..94232cff078 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -783,7 +783,7 @@ maininit (int ac, string *av) xputenv ("engine", TEXMFENGINENAME); /* Were we given a simple filename? */ - main_input_file = get_input_file_name(); + main_input_file = get_input_file_name (); #ifdef WIN32 if (main_input_file == NULL) { @@ -853,7 +853,9 @@ maininit (int ac, string *av) translate_filename = default_translate_filename; } /* If we're preloaded, I guess everything is set up. I don't really - know any more, it's been so long since anyone preloaded. */ + know any more, it's been so long since anyone truly preloaded. We + still use the word "preloaded" in the messages through (via the + original .web sources), at Knuth's request. */ if (readyalready != 314159) { /* The `ini_version' variable is declared/used in the change files. */ boolean virversion = false; @@ -873,9 +875,16 @@ maininit (int ac, string *av) #endif /* TeX */ } + /* If run like `tex \&foo', reasonable to guess "foo" as the fmt name. */ + if (!main_input_file) { + if (argv[1] && *argv[1] == '&') { + dump_name = argv[1] + 1; + } + } + if (!dump_name) { /* If called as *vir{mf,tex,mpost} use `plain'. Otherwise, use the - name we were invoked under. */ + name we were invoked under as our best guess. */ dump_name = (virversion ? "plain" : kpse_program_name); } } -- cgit v1.2.3