[ pdftex-Bugs-302 ] -jobname doesn't overcome texput
Bugs item #302, was opened at 2005-03-01 19:06 You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=493&aid=302&group_id=106 Category: web2c Group: v1.21a Status: Open Resolution: None Priority: 5 Submitted By: John Denker (jsd) Assigned to: Olaf Weber (infovore) Summary: -jobname doesn't overcome texput Initial Comment: Hi -- Suppose I want to pipe commands into pdflatex: echo '\typeout{---\jobname---}' | \ pdflatex --jobname foo You might expect that to type out ---foo--- but instead it types out ---texput--- I observe that --jobname works just fine for any filename I can think of, just not when the filename is absent entirely. I can offer two workarounds: 1) It's not documented, but nevertheless possible to \def\jobname{foo}. 2) Of course it's possible to stuff the commands into tmp.tex and then pdflatex --jobname foo tmp.tex Because these workarounds exist, I would rate this as a very low-priority bug. But it had me surprised and confused for a while. Given the overall high quality of the product, I thought I'd bring it to your attention. ---------------------------------------------------------------------- Comment By: Martin Schröder (oneiros) Date: 2005-05-13 16:38 Message: Logged In: YES user_id=421 This has been fixed in 1.30.0 ---------------------------------------------------------------------- Comment By: Olaf Weber (infovore) Date: 2005-04-12 18:22 Message: Logged In: YES user_id=1847 This is a general problem with the implementation of the --jobname switch in web2c. My proposed diff is a variant on Akira's work. It touches more files, but gives IMHO a cleaner interface to get_job_name() and less need for additional #defines. Unless there turns out to be something wrong with this, it will be merged in the web2c sources. lib/texmfmp.c | 6 ++++-- mf.ch | 6 +++++- mp.ch | 4 +++- tex.ch | 6 ++++-- web2c/coerce.h | 2 +- web2c/texmf.defines | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) Index: mf.ch =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/mf.ch,v retrieving revision 1.40 diff -u -d -r1.40 mf.ch --- mf.ch 28 Dec 2004 18:24:38 -0000 1.40 +++ mf.ch 12 Apr 2005 16:07:11 -0000 @@ -1717,8 +1717,12 @@ @z @x [38.788] Set correct filename for recorder. +if job_name=0 then job_name:="mfput"; +@.mfput@> pack_job_name(".log"); @y +if job_name=0 then job_name:=get_job_name("mfput"); +@.mfput@> pack_job_name(".fls"); recorder_change_filename(stringcast(name_of_file+1)); pack_job_name(".log"); @@ -1778,7 +1782,7 @@ @x [38.793] l.15938 - The job name may have been given on the command line. begin job_name:=cur_name; open_log_file; @y - begin job_name:=get_job_name; open_log_file; + begin job_name:=get_job_name(cur_name); open_log_file; @z @x [38.793] Can't return name to string pool because of editor option? Index: mp.ch =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/mp.ch,v retrieving revision 1.48 diff -u -d -r1.48 mp.ch --- mp.ch 28 Dec 2004 18:23:47 -0000 1.48 +++ mp.ch 12 Apr 2005 16:06:53 -0000 @@ -1403,8 +1403,10 @@ @z @x [35.765] Change name of recorder file. +if job_name=0 then job_name:="mpout"; pack_job_name(".log"); @y +if job_name=0 then job_name:=get_job_name("mpout"); pack_job_name(".fls"); recorder_change_filename(stringcast(name_of_file+1)); pack_job_name(".log"); @@ -1489,7 +1491,7 @@ incr(j); stop_at_space:=true; end_name; - job_name:=get_job_name; + job_name:=get_job_name(cur_name); str_ref[job_name] := max_str_ref; @z Index: tex.ch =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/tex.ch,v retrieving revision 1.89 diff -u -d -r1.89 tex.ch --- tex.ch 29 Dec 2004 11:08:23 -0000 1.89 +++ tex.ch 12 Apr 2005 16:07:26 -0000 @@ -2241,9 +2241,11 @@ @!months:^char; @z -@x [29.534] l.10289 - Filename change for the recorder. +@x [29.534] l.10300 - Filename change for the recorder. +if job_name=0 then job_name:="texput"; @.texput@> @y +if job_name=0 then job_name:=get_job_name("texput"); @.texput@> pack_job_name(".fls"); recorder_change_filename(stringcast(name_of_file+1)); @@ -2369,7 +2371,7 @@ @x [29.537] l.10352 - start_input: was job_name given on the command line? begin job_name:=cur_name; open_log_file; @y - begin job_name:=get_job_name; open_log_file; + begin job_name:=get_job_name(cur_name); open_log_file; @z @x [29.537] l.10356 - Index: lib/texmfmp.c =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/lib/texmfmp.c,v retrieving revision 1.108 diff -u -d -r1.108 texmfmp.c --- lib/texmfmp.c 12 Apr 2005 15:39:14 -0000 1.108 +++ lib/texmfmp.c 12 Apr 2005 15:55:17 -0000 @@ -1591,10 +1591,12 @@ return maketexstring(fullnameoffile); } +/* Get the job name to be used, which may have been set from the + command line. */ strnumber -getjobname() +getjobname(strnumber name) { - strnumber ret = curname; + strnumber ret = name; if (job_name != NULL) ret = maketexstring(job_name); return ret; Index: web2c/coerce.h =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/web2c/coerce.h,v retrieving revision 1.5 diff -u -d -r1.5 coerce.h --- web2c/coerce.h 26 Feb 2004 17:43:14 -0000 1.5 +++ web2c/coerce.h 12 Apr 2005 15:55:31 -0000 @@ -24,7 +24,7 @@ /* And we use the opportunity to declare a few functions that could not be declared in texmfmp.h, because they need typedefs not yet known at that point. */ -extern strnumber getjobname P1H(void); +extern strnumber getjobname P1H(strnumber); #ifdef MP /* MP defined poolASCIIcode instead of packedASCIIcode, sigh. */ Index: web2c/texmf.defines =================================================================== RCS file: /usr/local/cvsroot/texk/texk/web2c/web2c/texmf.defines,v retrieving revision 1.17 diff -u -d -r1.17 texmf.defines --- web2c/texmf.defines 14 Jul 2004 16:17:48 -0000 1.17 +++ web2c/texmf.defines 12 Apr 2005 15:58:51 -0000 @@ -22,7 +22,7 @@ @define function callmakempx (); @define function floorscaled (); @define function floorunscaled (); -@define function getjobname; +@define function getjobname (); @define function getrandomseed; @define function initscreen; @define function inputln (); ---------------------------------------------------------------------- Comment By: Martin Schröder (oneiros) Date: 2005-04-12 14:11 Message: Logged In: YES user_id=421 Patches provided by Akira on NTG-pdftex ---------------------------------------------------------------------- You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=493&aid=302&group_id=106
participants (1)
-
noreply@sarovar.org