summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tangleboot.pin
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2022-03-02 12:21:24 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2022-03-02 12:21:24 +0000
commit7dadfea71b290543fa374fbd1f5e83ec7101f4d8 (patch)
tree45f91b6e17ef2707e721df15fec8a09c164e1cfa /Build/source/texk/web2c/tangleboot.pin
parentbc2dcf1986356357fc6ea795ee5b7147b1286c2d (diff)
[WEB] Optional output file name.
The original WEB programs had fixed arguments on the commandline, i.e., you had to invoke TANGLE with four file name arguments and WEAVE with three (where '/dev/null' was permitted as an empty file). This change makes the WEB programs a little bit like the CWEB programs by allowing an optional third file name argument for the main output file (the name of the .pool file still is created from the .web file). And '-' is interpreted as an empty change file. git-svn-id: svn://tug.org/texlive/trunk@62337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tangleboot.pin')
-rw-r--r--Build/source/texk/web2c/tangleboot.pin12
1 files changed, 7 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/tangleboot.pin b/Build/source/texk/web2c/tangleboot.pin
index 29746a7a266..31eb05b511c 100644
--- a/Build/source/texk/web2c/tangleboot.pin
+++ b/Build/source/texk/web2c/tangleboot.pin
@@ -118,12 +118,14 @@ strictmode:=false;
end else if(strcmp(longoptions[optionindex].name,'length')=0)then begin
len:=atoi(optarg);if(len<=0)or(len>maxidlength)then len:=maxidlength;
unambiglength:=len;end;until getoptreturnval=-1;
-if(optind+1<>argc)and(optind+2<>argc)then begin writeln(stderr,'tangle',
-': Need one or two file arguments.');usage('tangle');end;
+if(optind+1>argc)or(optind+3<argc)then begin writeln(stderr,'tangle',
+': Need one to three file arguments.');usage('tangle');end;
webname:=extendfilename(cmdline(optind),'web');
-if optind+2=argc then begin chgname:=extendfilename(cmdline(optind+1),
-'ch');end;pascalname:=basenamechangesuffix(webname,'.web','.p');end;
-{:188}procedure initialize;var{16:}i:0..255;{:16}{41:}wi:0..2;
+if optind+2<=argc then begin if strcmp(chartostring('-'),cmdline(optind
++1))<>0 then chgname:=extendfilename(cmdline(optind+1),'ch');end;
+if optind+3=argc then pascalname:=extendfilename(cmdline(optind+2),
+chartostring('p'))else pascalname:=basenamechangesuffix(webname,'.web',
+'.p');end;{:188}procedure initialize;var{16:}i:0..255;{:16}{41:}wi:0..2;
{:41}{45:}zi:0..4;{:45}{51:}h:0..hashsize;
{:51}begin kpsesetprogramname(argv[0],'tangle');parsearguments;
{10:}history:=0;{:10}{14:}xchr[32]:=' ';xchr[33]:='!';xchr[34]:='"';