texlive[68365] Build/source/texk/web2c: [CWEB] Check for available

commits+ascherer at tug.org commits+ascherer at tug.org
Mon Sep 25 17:15:19 CEST 2023


Revision: 68365
          https://tug.org/svn/texlive?view=revision&revision=68365
Author:   ascherer
Date:     2023-09-25 17:15:18 +0200 (Mon, 25 Sep 2023)
Log Message:
-----------
[CWEB] Check for available input.

If, for example, the name of a changefile is misspelled, you'd
get '(l. 0)' and an extra linebreak.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebboot.cin
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
    trunk/Build/source/texk/web2c/cwebdir/common.c
    trunk/Build/source/texk/web2c/cwebdir/common.w

Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin	2023-09-24 23:42:54 UTC (rev 68364)
+++ trunk/Build/source/texk/web2c/cwebboot.cin	2023-09-25 15:15:18 UTC (rev 68365)
@@ -26,20 +26,20 @@
 #line 75 "cwebdir/comm-w2c.h"
 
 /*:4*//*91:*/
-#line 737 "cwebdir/comm-w2c.ch"
+#line 739 "cwebdir/comm-w2c.ch"
 
 #if HAVE_GETTEXT
 #include <locale.h>  
 #else
-#line 741 "cwebdir/comm-w2c.ch"
+#line 743 "cwebdir/comm-w2c.ch"
 #define setlocale(a,b) ""
 #define bindtextdomain(a,b) ""
 #define textdomain(a) ""
 #endif
-#line 745 "cwebdir/comm-w2c.ch"
+#line 747 "cwebdir/comm-w2c.ch"
 
 /*:91*//*93:*/
-#line 784 "cwebdir/comm-w2c.ch"
+#line 786 "cwebdir/comm-w2c.ch"
 
 #include <kpathsea/kpathsea.h>  
 
@@ -47,7 +47,7 @@
 #include <lib/lib.h>  
 
 /*:93*//*96:*/
-#line 821 "cwebdir/comm-w2c.ch"
+#line 823 "cwebdir/comm-w2c.ch"
 
 #define CWEB
 #include "help.h" 
@@ -375,7 +375,7 @@
 int history= spotless;
 
 /*:65*//*73:*/
-#line 1125 "cwebdir/common.w"
+#line 1127 "cwebdir/common.w"
 
 int argc;
 char**argv;
@@ -382,33 +382,33 @@
 char C_file_name[max_file_name_length];
 char tex_file_name[max_file_name_length];
 char idx_file_name[max_file_name_length];
-#line 454 "cwebdir/comm-w2c.ch"
+#line 456 "cwebdir/comm-w2c.ch"
 char scn_file_name[max_file_name_length];
 char check_file_name[max_file_name_length];
-#line 1132 "cwebdir/common.w"
+#line 1134 "cwebdir/common.w"
 boolean flags[128];
 
 /*:73*//*83:*/
-#line 1268 "cwebdir/common.w"
+#line 1270 "cwebdir/common.w"
 
 FILE*C_file;
 FILE*tex_file;
 FILE*idx_file;
 FILE*scn_file;
-#line 582 "cwebdir/comm-w2c.ch"
+#line 584 "cwebdir/comm-w2c.ch"
 FILE*active_file;
 FILE*check_file;
-#line 1274 "cwebdir/common.w"
+#line 1276 "cwebdir/common.w"
 
-#line 599 "cwebdir/comm-w2c.ch"
+#line 601 "cwebdir/comm-w2c.ch"
 /*:83*//*86:*/
-#line 627 "cwebdir/comm-w2c.ch"
+#line 629 "cwebdir/comm-w2c.ch"
 
 const char*use_language= "";
 
 
 /*:86*//*87:*/
-#line 640 "cwebdir/comm-w2c.ch"
+#line 642 "cwebdir/comm-w2c.ch"
 
 char cb_banner[max_banner];
 string texmf_locale;
@@ -415,7 +415,7 @@
 #ifndef SEPARATORS
 #define SEPARATORS "://"
 #endif
-#line 646 "cwebdir/comm-w2c.ch"
+#line 648 "cwebdir/comm-w2c.ch"
  char separators[]= SEPARATORS;
 
 /*:87*/
@@ -483,12 +483,12 @@
 static int section_name_cmp(char**,size_t,name_pointer);
 
 /*:64*//*76:*/
-#line 1185 "cwebdir/common.w"
+#line 1187 "cwebdir/common.w"
 static void scan_args(void);
 
-#line 512 "cwebdir/comm-w2c.ch"
+#line 514 "cwebdir/comm-w2c.ch"
 /*:76*//*98:*/
-#line 834 "cwebdir/comm-w2c.ch"
+#line 836 "cwebdir/comm-w2c.ch"
 
 static void cb_usage(const_string str);
 static void cb_usagehelp(const_string*message);
@@ -521,7 +521,7 @@
 #line 78 "cwebdir/comm-w2c.ch"
 
 /*94:*/
-#line 796 "cwebdir/comm-w2c.ch"
+#line 798 "cwebdir/comm-w2c.ch"
 
 kpse_set_program_name(argv[0],"cweb");
 
@@ -530,7 +530,7 @@
 
 #line 85 "cwebdir/comm-w2c.ch"
 /*92:*/
-#line 746 "cwebdir/comm-w2c.ch"
+#line 748 "cwebdir/comm-w2c.ch"
 
 setlocale(LC_MESSAGES,setlocale(LC_CTYPE,""));
 texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}");
@@ -549,11 +549,11 @@
 #line 85 "cwebdir/comm-w2c.ch"
 
 /*74:*/
-#line 1138 "cwebdir/common.w"
+#line 1140 "cwebdir/common.w"
 
-#line 461 "cwebdir/comm-w2c.ch"
+#line 463 "cwebdir/comm-w2c.ch"
 make_xrefs= true;
-#line 1140 "cwebdir/common.w"
+#line 1142 "cwebdir/common.w"
 
 /*:74*/
 #line 86 "cwebdir/comm-w2c.ch"
@@ -560,12 +560,12 @@
 
 #line 101 "cwebdir/common.w"
 /*84:*/
-#line 599 "cwebdir/comm-w2c.ch"
+#line 601 "cwebdir/comm-w2c.ch"
 
 scan_args();
 if(program==ctangle){
 if(check_for_change)/*88:*/
-#line 657 "cwebdir/comm-w2c.ch"
+#line 659 "cwebdir/comm-w2c.ch"
 {
 if((C_file= fopen(C_file_name,"a"))==NULL)
 fatal(_("! Cannot open output file "),C_file_name);
@@ -582,7 +582,7 @@
 }
 
 /*:88*/
-#line 602 "cwebdir/comm-w2c.ch"
+#line 604 "cwebdir/comm-w2c.ch"
 
 else if((C_file= fopen(C_file_name,"wb"))==NULL)
 fatal(_("! Cannot open output file "),C_file_name);
@@ -590,7 +590,7 @@
 }
 else{
 if(check_for_change)/*89:*/
-#line 672 "cwebdir/comm-w2c.ch"
+#line 674 "cwebdir/comm-w2c.ch"
 {
 if((tex_file= fopen(tex_file_name,"a"))==NULL)
 fatal(_("! Cannot open output file "),tex_file_name);
@@ -607,14 +607,14 @@
 }
 
 /*:89*/
-#line 608 "cwebdir/comm-w2c.ch"
+#line 610 "cwebdir/comm-w2c.ch"
 
 else if((tex_file= fopen(tex_file_name,"wb"))==NULL)
 fatal(_("! Cannot open output file "),tex_file_name);
 }
-#line 1286 "cwebdir/common.w"
+#line 1288 "cwebdir/common.w"
 
-#line 617 "cwebdir/comm-w2c.ch"
+#line 619 "cwebdir/comm-w2c.ch"
 /*:84*/
 #line 101 "cwebdir/common.w"
 
@@ -1314,12 +1314,14 @@
 #line 1031 "cwebdir/common.w"
 
 {char*k,*l;
-if(changing&&include_depth==change_depth)
-#line 371 "cwebdir/comm-w2c.ch"
+if(changing&&include_depth==change_depth&&change_line> 0)
+#line 372 "cwebdir/comm-w2c.ch"
 printf(_(". (l. %d of change file)\n"),change_line);
-else if(include_depth==0)printf(_(". (l. %d)\n"),cur_line);
+else if(cur_line> 0){
+if(include_depth==0)printf(_(". (l. %d)\n"),cur_line);
 else printf(_(". (l. %d of include file %s)\n"),cur_line,cur_file_name);
-#line 1037 "cwebdir/common.w"
+#line 1038 "cwebdir/common.w"
+}
 l= (loc>=limit?limit:loc);
 if(l> buffer){
 for(k= buffer;k<l;k++)
@@ -1340,18 +1342,18 @@
 }
 
 /*:66*//*68:*/
-#line 1064 "cwebdir/common.w"
+#line 1066 "cwebdir/common.w"
 
 int wrap_up(void){
 if(show_progress||show_happiness||history!=spotless)new_line();
 if(show_stats)
 print_stats();
-#line 401 "cwebdir/comm-w2c.ch"
+#line 403 "cwebdir/comm-w2c.ch"
 /*69:*/
-#line 1074 "cwebdir/common.w"
+#line 1076 "cwebdir/common.w"
 
 switch(history){
-#line 427 "cwebdir/comm-w2c.ch"
+#line 429 "cwebdir/comm-w2c.ch"
 case spotless:
 if(show_happiness)puts(_("(No errors were found.)"));break;
 case harmless_message:
@@ -1360,14 +1362,14 @@
 puts(_("(Pardon me, but I think I spotted something wrong.)"));break;
 case fatal_message:default:
 puts(_("(That was a fatal error, my friend.)"));
-#line 1084 "cwebdir/common.w"
+#line 1086 "cwebdir/common.w"
 }
 
 /*:69*/
-#line 401 "cwebdir/comm-w2c.ch"
+#line 403 "cwebdir/comm-w2c.ch"
 
 /*90:*/
-#line 690 "cwebdir/comm-w2c.ch"
+#line 692 "cwebdir/comm-w2c.ch"
 
 if(C_file)fclose(C_file);
 if(tex_file)fclose(tex_file);
@@ -1376,9 +1378,9 @@
 remove(check_file_name);
 
 /*:90*/
-#line 402 "cwebdir/comm-w2c.ch"
+#line 404 "cwebdir/comm-w2c.ch"
 
-#line 409 "cwebdir/comm-w2c.ch"
+#line 411 "cwebdir/comm-w2c.ch"
 switch(history){
 case spotless:return RETURN_OK;
 case harmless_message:return RETURN_WARN;
@@ -1385,11 +1387,11 @@
 case error_message:return RETURN_ERROR;
 case fatal_message:default:return RETURN_FAIL;
 }
-#line 1072 "cwebdir/common.w"
+#line 1074 "cwebdir/common.w"
 }
 
 /*:68*//*70:*/
-#line 1092 "cwebdir/common.w"
+#line 1094 "cwebdir/common.w"
 void
 fatal(
 const char*s,const char*t)
@@ -1400,19 +1402,19 @@
 }
 
 /*:70*//*71:*/
-#line 1103 "cwebdir/common.w"
+#line 1105 "cwebdir/common.w"
 void
 overflow(
 const char*t)
 {
-#line 440 "cwebdir/comm-w2c.ch"
+#line 442 "cwebdir/comm-w2c.ch"
 printf(_("\n! Sorry, %s capacity exceeded"),t);fatal("","");
-#line 1108 "cwebdir/common.w"
+#line 1110 "cwebdir/common.w"
 }
 
 
 /*:71*//*75:*/
-#line 1156 "cwebdir/common.w"
+#line 1158 "cwebdir/common.w"
 
 static void
 scan_args(void)
@@ -1423,29 +1425,29 @@
 boolean found_web= false,found_change= false,found_out= false;
 
 
-#line 484 "cwebdir/comm-w2c.ch"
+#line 486 "cwebdir/comm-w2c.ch"
 strcpy(change_file_name,"/dev/null");
 #if defined DEV_NULL
 strncpy(change_file_name,DEV_NULL,max_file_name_length-2);
 change_file_name[max_file_name_length-2]= '\0';
 #elif defined _DEV_NULL
-#line 489 "cwebdir/comm-w2c.ch"
+#line 491 "cwebdir/comm-w2c.ch"
  strncpy(change_file_name,_DEV_NULL,max_file_name_length-2);
 change_file_name[max_file_name_length-2]= '\0';
 #endif
-#line 492 "cwebdir/comm-w2c.ch"
+#line 494 "cwebdir/comm-w2c.ch"
 
-#line 1167 "cwebdir/common.w"
+#line 1169 "cwebdir/common.w"
  while(--argc> 0){
 if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
-#line 1246 "cwebdir/common.w"
+#line 1248 "cwebdir/common.w"
 
-#line 525 "cwebdir/comm-w2c.ch"
+#line 527 "cwebdir/comm-w2c.ch"
 {
 if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
 
 /*97:*/
-#line 825 "cwebdir/comm-w2c.ch"
+#line 827 "cwebdir/comm-w2c.ch"
 
 cb_usagehelp(program==ctangle?CTANGLEHELP:
 program==cweave?CWEAVEHELP:CTWILLHELP);
@@ -1452,12 +1454,12 @@
 
 
 /*:97*/
-#line 528 "cwebdir/comm-w2c.ch"
+#line 530 "cwebdir/comm-w2c.ch"
 
 if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
 
 /*100:*/
-#line 871 "cwebdir/comm-w2c.ch"
+#line 873 "cwebdir/comm-w2c.ch"
 
 printversionandexit(cb_banner,
 program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth",
@@ -1465,7 +1467,7 @@
 
 
 /*:100*/
-#line 531 "cwebdir/comm-w2c.ch"
+#line 533 "cwebdir/comm-w2c.ch"
 
 if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0)
 
@@ -1479,15 +1481,15 @@
 case'q':show_banner= show_progress= show_happiness= false;continue;
 case'd':
 if(sscanf(++dot_pos,"%u",&kpathsea_debug)!=1)/*81:*/
-#line 568 "cwebdir/comm-w2c.ch"
+#line 570 "cwebdir/comm-w2c.ch"
 
 cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
 
-#line 1261 "cwebdir/common.w"
+#line 1263 "cwebdir/common.w"
 
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 /*:81*/
-#line 543 "cwebdir/comm-w2c.ch"
+#line 545 "cwebdir/comm-w2c.ch"
 
 while(isdigit(*dot_pos))dot_pos++;
 dot_pos--;
@@ -1498,35 +1500,35 @@
 break;
 }
 }
-#line 1249 "cwebdir/common.w"
+#line 1251 "cwebdir/common.w"
 
-#line 568 "cwebdir/comm-w2c.ch"
+#line 570 "cwebdir/comm-w2c.ch"
 /*:80*/
-#line 1168 "cwebdir/common.w"
+#line 1170 "cwebdir/common.w"
 
 else{
 s= name_pos= *argv;dot_pos= NULL;
 while(*s)
-#line 500 "cwebdir/comm-w2c.ch"
+#line 502 "cwebdir/comm-w2c.ch"
 if(*s=='.')dot_pos= s++;
 else if(*s==DIR_SEPARATOR||*s==DEVICE_SEPARATOR||*s=='/')
 dot_pos= NULL,name_pos= ++s;
 else s++;
 
-#line 1175 "cwebdir/common.w"
+#line 1177 "cwebdir/common.w"
 if(!found_web)/*77:*/
-#line 1194 "cwebdir/common.w"
+#line 1196 "cwebdir/common.w"
 
 {
 if(s-*argv> max_file_name_length-5)
 /*82:*/
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 fatal(_("! Filename too long\n"),*argv);
-#line 1263 "cwebdir/common.w"
+#line 1265 "cwebdir/common.w"
 
 
 /*:82*/
-#line 1197 "cwebdir/common.w"
+#line 1199 "cwebdir/common.w"
 
 if(dot_pos==NULL)
 sprintf(web_file_name,"%s.w",*argv);
@@ -1534,7 +1536,7 @@
 strcpy(web_file_name,*argv);
 *dot_pos= '\0';
 }
-#line 1205 "cwebdir/common.w"
+#line 1207 "cwebdir/common.w"
 sprintf(tex_file_name,"%s.tex",name_pos);
 if(make_xrefs){
 sprintf(idx_file_name,"%s.idx",name_pos);
@@ -1545,22 +1547,22 @@
 }
 
 /*:77*/
-#line 1176 "cwebdir/common.w"
+#line 1178 "cwebdir/common.w"
 
 else if(!found_change)/*78:*/
-#line 1214 "cwebdir/common.w"
+#line 1216 "cwebdir/common.w"
 
 {
 if(strcmp(*argv,"-")!=0){
 if(s-*argv> max_file_name_length-4)
 /*82:*/
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 fatal(_("! Filename too long\n"),*argv);
-#line 1263 "cwebdir/common.w"
+#line 1265 "cwebdir/common.w"
 
 
 /*:82*/
-#line 1218 "cwebdir/common.w"
+#line 1220 "cwebdir/common.w"
 
 if(dot_pos==NULL)
 sprintf(change_file_name,"%s.ch",*argv);
@@ -1570,21 +1572,21 @@
 }
 
 /*:78*/
-#line 1177 "cwebdir/common.w"
+#line 1179 "cwebdir/common.w"
 
 else if(!found_out)/*79:*/
-#line 1226 "cwebdir/common.w"
+#line 1228 "cwebdir/common.w"
 
 {
 if(s-*argv> max_file_name_length-5)
 /*82:*/
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 fatal(_("! Filename too long\n"),*argv);
-#line 1263 "cwebdir/common.w"
+#line 1265 "cwebdir/common.w"
 
 
 /*:82*/
-#line 1229 "cwebdir/common.w"
+#line 1231 "cwebdir/common.w"
 
 if(dot_pos==NULL){
 sprintf(tex_file_name,"%s.tex",*argv);
@@ -1602,36 +1604,36 @@
 }
 
 /*:79*/
-#line 1178 "cwebdir/common.w"
+#line 1180 "cwebdir/common.w"
 
 else/*81:*/
-#line 568 "cwebdir/comm-w2c.ch"
+#line 570 "cwebdir/comm-w2c.ch"
 
 cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
 
-#line 1261 "cwebdir/common.w"
+#line 1263 "cwebdir/common.w"
 
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 /*:81*/
-#line 1179 "cwebdir/common.w"
+#line 1181 "cwebdir/common.w"
 
 }
 }
 if(!found_web)/*81:*/
-#line 568 "cwebdir/comm-w2c.ch"
+#line 570 "cwebdir/comm-w2c.ch"
 
 cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
 
-#line 1261 "cwebdir/common.w"
+#line 1263 "cwebdir/common.w"
 
-#line 576 "cwebdir/comm-w2c.ch"
+#line 578 "cwebdir/comm-w2c.ch"
 /*:81*/
-#line 1182 "cwebdir/common.w"
+#line 1184 "cwebdir/common.w"
 
 }
 
 /*:75*//*99:*/
-#line 838 "cwebdir/comm-w2c.ch"
+#line 840 "cwebdir/comm-w2c.ch"
 
 static void cb_usage(const_string str)
 {
@@ -1663,7 +1665,7 @@
 }
 
 /*:99*//*101:*/
-#line 879 "cwebdir/comm-w2c.ch"
+#line 881 "cwebdir/comm-w2c.ch"
 
 void cb_show_banner(void)
 {

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-09-24 23:42:54 UTC (rev 68364)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-09-25 15:15:18 UTC (rev 68365)
@@ -1,3 +1,9 @@
+2023-09-25  Andreas Scherer  <https://ascherer.github.io>
+
+	* comm-w2c.h,
+	* common.c,
+	* common.w: Check for available input.
+
 2023-09-24  Andreas Scherer  <https://ascherer.github.io>
 
 	* comm-w2c.h,

Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2023-09-24 23:42:54 UTC (rev 68364)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2023-09-25 15:15:18 UTC (rev 68365)
@@ -365,11 +365,13 @@
 
 @x
   printf(". (l. %d of change file)\n", change_line);
-else if (include_depth==0) printf(". (l. %d)\n", cur_line);
+else if (cur_line>0) {
+  if (include_depth==0) printf(". (l. %d)\n", cur_line);
   else printf(". (l. %d of include file %s)\n", cur_line, cur_file_name);
 @y
   printf(_(". (l. %d of change file)\n"), change_line);
-else if (include_depth==0) printf(_(". (l. %d)\n"), cur_line);
+else if (cur_line>0) {
+  if (include_depth==0) printf(_(". (l. %d)\n"), cur_line);
   else printf(_(". (l. %d of include file %s)\n"), cur_line, cur_file_name);
 @z
 

Modified: trunk/Build/source/texk/web2c/cwebdir/common.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.c	2023-09-24 23:42:54 UTC (rev 68364)
+++ trunk/Build/source/texk/web2c/cwebdir/common.c	2023-09-25 15:15:18 UTC (rev 68365)
@@ -312,7 +312,7 @@
 int history= spotless;
 
 /*:65*//*73:*/
-#line 1125 "common.w"
+#line 1127 "common.w"
 
 int argc;
 char**argv;
@@ -323,7 +323,7 @@
 boolean flags[128];
 
 /*:73*//*83:*/
-#line 1268 "common.w"
+#line 1270 "common.w"
 
 FILE*C_file;
 FILE*tex_file;
@@ -394,7 +394,7 @@
 static int section_name_cmp(char**,size_t,name_pointer);
 
 /*:64*//*76:*/
-#line 1185 "common.w"
+#line 1187 "common.w"
 static void scan_args(void);
 
 /*:76*/
@@ -424,7 +424,7 @@
 #line 99 "common.w"
 
 /*74:*/
-#line 1138 "common.w"
+#line 1140 "common.w"
 
 show_banner= show_happiness= show_progress= make_xrefs= true;
 
@@ -432,7 +432,7 @@
 #line 100 "common.w"
 
 /*84:*/
-#line 1275 "common.w"
+#line 1277 "common.w"
 
 scan_args();
 if(program==ctangle){
@@ -1092,10 +1092,12 @@
 #line 1031 "common.w"
 
 {char*k,*l;
-if(changing&&include_depth==change_depth)
+if(changing&&include_depth==change_depth&&change_line> 0)
 printf(". (l. %d of change file)\n",change_line);
-else if(include_depth==0)printf(". (l. %d)\n",cur_line);
+else if(cur_line> 0){
+if(include_depth==0)printf(". (l. %d)\n",cur_line);
 else printf(". (l. %d of include file %s)\n",cur_line,cur_file_name);
+}
 l= (loc>=limit?limit:loc);
 if(l> buffer){
 for(k= buffer;k<l;k++)
@@ -1116,7 +1118,7 @@
 }
 
 /*:66*//*68:*/
-#line 1064 "common.w"
+#line 1066 "common.w"
 
 int wrap_up(void){
 if(show_progress||show_happiness||history!=spotless)new_line();
@@ -1123,7 +1125,7 @@
 if(show_stats)
 print_stats();
 /*69:*/
-#line 1074 "common.w"
+#line 1076 "common.w"
 
 switch(history){
 case spotless:
@@ -1137,7 +1139,7 @@
 }
 
 /*:69*/
-#line 1069 "common.w"
+#line 1071 "common.w"
 
 if(history> harmless_message)return EXIT_FAILURE;
 else return EXIT_SUCCESS;
@@ -1144,7 +1146,7 @@
 }
 
 /*:68*//*70:*/
-#line 1092 "common.w"
+#line 1094 "common.w"
 void
 fatal(
 const char*s,const char*t)
@@ -1155,7 +1157,7 @@
 }
 
 /*:70*//*71:*/
-#line 1103 "common.w"
+#line 1105 "common.w"
 void
 overflow(
 const char*t)
@@ -1165,7 +1167,7 @@
 
 
 /*:71*//*75:*/
-#line 1156 "common.w"
+#line 1158 "common.w"
 
 static void
 scan_args(void)
@@ -1179,13 +1181,13 @@
 strcpy(change_file_name,"/dev/null");
 while(--argc> 0){
 if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
-#line 1246 "common.w"
+#line 1248 "common.w"
 
 for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++)
 flags[(eight_bits)*dot_pos]= flag_change;
 
 /*:80*/
-#line 1168 "common.w"
+#line 1170 "common.w"
 
 else{
 s= name_pos= *argv;dot_pos= NULL;
@@ -1194,17 +1196,17 @@
 else if(*s=='/')dot_pos= NULL,name_pos= ++s;
 else s++;
 if(!found_web)/*77:*/
-#line 1194 "common.w"
+#line 1196 "common.w"
 
 {
 if(s-*argv> max_file_name_length-5)
 /*82:*/
-#line 1262 "common.w"
+#line 1264 "common.w"
 fatal("! Filename too long\n",*argv);
 
 
 /*:82*/
-#line 1197 "common.w"
+#line 1199 "common.w"
 
 if(dot_pos==NULL)
 sprintf(web_file_name,"%s.w",*argv);
@@ -1223,21 +1225,21 @@
 }
 
 /*:77*/
-#line 1176 "common.w"
+#line 1178 "common.w"
 
 else if(!found_change)/*78:*/
-#line 1214 "common.w"
+#line 1216 "common.w"
 
 {
 if(strcmp(*argv,"-")!=0){
 if(s-*argv> max_file_name_length-4)
 /*82:*/
-#line 1262 "common.w"
+#line 1264 "common.w"
 fatal("! Filename too long\n",*argv);
 
 
 /*:82*/
-#line 1218 "common.w"
+#line 1220 "common.w"
 
 if(dot_pos==NULL)
 sprintf(change_file_name,"%s.ch",*argv);
@@ -1247,20 +1249,20 @@
 }
 
 /*:78*/
-#line 1177 "common.w"
+#line 1179 "common.w"
 
 else if(!found_out)/*79:*/
-#line 1226 "common.w"
+#line 1228 "common.w"
 
 {
 if(s-*argv> max_file_name_length-5)
 /*82:*/
-#line 1262 "common.w"
+#line 1264 "common.w"
 fatal("! Filename too long\n",*argv);
 
 
 /*:82*/
-#line 1229 "common.w"
+#line 1231 "common.w"
 
 if(dot_pos==NULL){
 sprintf(tex_file_name,"%s.tex",*argv);
@@ -1278,10 +1280,10 @@
 }
 
 /*:79*/
-#line 1178 "common.w"
+#line 1180 "common.w"
 
 else/*81:*/
-#line 1250 "common.w"
+#line 1252 "common.w"
 
 {
 if(program==ctangle)
@@ -1295,12 +1297,12 @@
 }
 
 /*:81*/
-#line 1179 "common.w"
+#line 1181 "common.w"
 
 }
 }
 if(!found_web)/*81:*/
-#line 1250 "common.w"
+#line 1252 "common.w"
 
 {
 if(program==ctangle)
@@ -1314,7 +1316,7 @@
 }
 
 /*:81*/
-#line 1182 "common.w"
+#line 1184 "common.w"
 
 }
 

Modified: trunk/Build/source/texk/web2c/cwebdir/common.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.w	2023-09-24 23:42:54 UTC (rev 68364)
+++ trunk/Build/source/texk/web2c/cwebdir/common.w	2023-09-25 15:15:18 UTC (rev 68365)
@@ -1030,10 +1030,12 @@
 
 @<Print error location based on input buffer@>=
 {char *k,*l; /* pointers into |buffer| */
-if (changing && include_depth==change_depth)
+if (changing && include_depth==change_depth && change_line>0)
   printf(". (l. %d of change file)\n", change_line);
-else if (include_depth==0) printf(". (l. %d)\n", cur_line);
+else if (cur_line>0) {
+  if (include_depth==0) printf(". (l. %d)\n", cur_line);
   else printf(". (l. %d of include file %s)\n", cur_line, cur_file_name);
+}
 l= (loc>=limit? limit: loc);
 if (l>buffer) {
   for (k=buffer; k<l; k++)



More information about the tex-live-commits mailing list.