summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2023-08-11 16:49:21 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2023-08-11 16:49:21 +0000
commit582b28abe170d28b8c4c97b2d2fe60f177dd2733 (patch)
treea37e557a9dabb019346de85a4d2d805fbbc35947 /Build/source
parent673c73e2e15ed3913707bf24f18ca92857efc8ed (diff)
[CWEB] Refurbish 'phase_three'.
git-svn-id: svn://tug.org/texlive/trunk@67887 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/cwebdir/ctwill-mini.ch8
-rw-r--r--Build/source/texk/web2c/cwebdir/ctwill-w2c.ch34
-rw-r--r--Build/source/texk/web2c/cwebdir/cweav-w2c.ch28
-rw-r--r--Build/source/texk/web2c/cwebdir/cweave.w26
5 files changed, 40 insertions, 63 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index 9a83c7963fd..1a77bcdf763 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-11 Andreas Scherer <https://ascherer.github.io>
+
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch,
+ * cweave.w: Refurbish 'phase_three'.
+
2023-08-08 Andreas Scherer <https://ascherer.github.io>
* comm-w2c.ch,
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
index 463e238010e..a5b4f759faa 100644
--- a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
+++ b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
@@ -1874,6 +1874,14 @@ Section 261.
@-footnote@>
@z
+Section 264.
+
+@x
+@** Phase three processing.
+@y
+@r @** Phase three processing.
+@z
+
Section 265.
@x
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
index 78d42b860ea..a65dcf79151 100644
--- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
@@ -1112,24 +1112,16 @@ out_str("}\\FI"); finish_line();
@z
@x
-if (no_xref) {
- finish_line();
- out_str("\\end");
-@.\\end@>
- finish_line();
-}
+ if (show_progress) fputs("\nWriting the index...",stdout);
@y
-if (no_xref) {
- finish_line();
- out_str("\\end");
-@.\\end@>
-}
+ if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
+ if (change_exists) {
+ @<Tell about changed sections@>@; finish_line(); finish_line();
+ }
@y
- phase=3; if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
@@ -1139,27 +1131,15 @@ if (no_xref) {
@z
@x
- if (change_exists) {
- @<Tell about changed sections@>@; finish_line(); finish_line();
- }
-@y
-@z
-
-@x
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@z
@x
-@.\\end@>
- finish_line();
- fclose(active_file);
-}
+fclose(active_file);
@y
-@.\\end@>
-}
-finish_line(); fclose(active_file); active_file=tex_file=NULL;
+fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
index 90ff6b8ee09..f60360c791d 100644
--- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
@@ -515,24 +515,9 @@ if (show_progress) fputs(_("\nWriting the output file..."),stdout);
@z
@x
-if (no_xref) {
- finish_line();
- out_str("\\end");
-@.\\end@>
- finish_line();
-}
-@y
-if (no_xref) {
- finish_line();
- out_str("\\end");
-@.\\end@>
-}
-@z
-
-@x
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
+ if (show_progress) fputs("\nWriting the index...",stdout);
@y
- phase=3; if (show_progress) fputs(_("\nWriting the index..."),stdout);
+ if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
@@ -548,14 +533,9 @@ if (no_xref) {
@z
@x
-@.\\end@>
- finish_line();
- fclose(active_file);
-}
+fclose(active_file);
@y
-@.\\end@>
-}
-finish_line(); fclose(active_file); active_file=tex_file=NULL;
+fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w
index 4cd934c1e1b..41ade6e503d 100644
--- a/Build/source/texk/web2c/cwebdir/cweave.w
+++ b/Build/source/texk/web2c/cwebdir/cweave.w
@@ -4525,44 +4525,46 @@ contents.
@c
static void
phase_three(void) {
-if (no_xref) {
- finish_line();
+phase=3;
+finish_line(); /* the bulk of |tex_file| has been written */
+if (no_xref)
out_str("\\end");
@.\\end@>
- finish_line();
-}
else {
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
+ if (show_progress) fputs("\nWriting the index...",stdout);
@.Writing the index...@>
- finish_line();
- if ((idx_file=fopen(idx_file_name,"wb"))==NULL)
- fatal("! Cannot open index file ",idx_file_name);
-@.Cannot open index file@>
if (change_exists) {
@<Tell about changed sections@>@; finish_line(); finish_line();
}
out_str("\\inx"); finish_line();
@.\\inx@>
+@#
+ if ((idx_file=fopen(idx_file_name,"wb"))==NULL)
+ fatal("! Cannot open index file ",idx_file_name);
+@.Cannot open index file@>
active_file=idx_file; /* change active file to the index file */
@<Do the first pass of sorting@>@;
@<Sort and output the index@>@;
finish_line(); fclose(active_file); /* finished with |idx_file| */
+@#
active_file=tex_file; /* switch back to |tex_file| for a tic */
out_str("\\fin"); finish_line();
@.\\fin@>
+@#
if ((scn_file=fopen(scn_file_name,"wb"))==NULL)
fatal("! Cannot open section file ",scn_file_name);
@.Cannot open section file@>
active_file=scn_file; /* change active file to section listing file */
@<Output all the section names@>@;
finish_line(); fclose(active_file); /* finished with |scn_file| */
- active_file=tex_file;
+@#
+ active_file=tex_file; /* switch back to |tex_file| for the last time */
if (group_found) out_str("\\con");@+else out_str("\\end");
@.\\con@>
@.\\end@>
- finish_line();
- fclose(active_file);
}
+finish_line();
+fclose(active_file);
if (show_happiness) {
if (show_progress) new_line();
fputs("Done.",stdout);