diff options
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 15 |
2 files changed, 19 insertions, 3 deletions
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 <igor.liferenko@gmail.com> + + * 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 <https://ascherer.github.io> * 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); } } |