texlive[68979] Build/source/texk/web2c/hitexdir/hitex.w: HINT: free

commits+mruckert at tug.org commits+mruckert at tug.org
Mon Nov 27 12:16:42 CET 2023


Revision: 68979
          https://tug.org/svn/texlive?view=revision&revision=68979
Author:   mruckert
Date:     2023-11-27 12:16:42 +0100 (Mon, 27 Nov 2023)
Log Message:
-----------
HINT: free filename stack entries if NOT NULL

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/hitexdir/hitex.w

Modified: trunk/Build/source/texk/web2c/hitexdir/hitex.w
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hitex.w	2023-11-27 00:43:24 UTC (rev 68978)
+++ trunk/Build/source/texk/web2c/hitexdir/hitex.w	2023-11-27 11:16:42 UTC (rev 68979)
@@ -7527,6 +7527,10 @@
 {@+first=start;line=line_stack[index];
 if ((name==18)||(name==19)) pseudo_close();else
 if (name > 17) a_close(&cur_file); /*forget it*/
+if (full_source_filename_stack[in_open]!=NULL)
+{ free(full_source_filename_stack[in_open]);
+  full_source_filename_stack[in_open]=NULL;
+}
 pop_input;decr(in_open);
 }
 
@@ -10996,10 +11000,10 @@
   prompt_file_name("input file name",".tex");
   }
 done: name=a_make_name_string(&cur_file);@/
-if (source_filename_stack[in_open]==NULL)
+if (source_filename_stack[in_open]!=NULL)
   free(source_filename_stack[in_open]);
 source_filename_stack[in_open]=strdup((char *)name_of_file+1); /*\TeX\ Live*/
-if (full_source_filename_stack[in_open]==NULL)
+if (full_source_filename_stack[in_open]!=NULL)
   free(full_source_filename_stack[in_open]);
 full_source_filename_stack[in_open]=strdup(full_name_of_file);
 if (job_name==0)
@@ -34886,6 +34890,10 @@
         fname++;
   }
   filename = kpse_find_file(fname, t, mx);
+  if (full_name_of_file!=NULL)
+  { free(full_name_of_file); full_name_of_file=NULL;}
+  if (filename!=NULL)
+    full_name_of_file=strdup(filename);
   if (quoted) {
         /* Undo modifications */
         fname--;
@@ -34948,7 +34956,8 @@
 }
 
 @ We need a stack, matching the |line_stack| that
-contains the source file names;
+contains the source file names. For the full source filenames we use
+poiters to |char| because these names are just used for output.
 
 @<Global...@>=
 static char * @!source_filename_stack0[max_in_open]={NULL}, **const @!source_filename_stack = @!source_filename_stack0-1;



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