texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Sat, 13 Apr 2024 09:59:39 -0400 (EDT)

branch: master
commit 39921b2757e3761f86aa440e336214f06efb06e6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Apr 13 13:19:09 2024 +0200

    * tp/Texinfo/Common.pm, tp/texi2any.pl: change in comments for a more
    accurate description of duplicates in opened_files.
---
 ChangeLog            |  5 +++++
 tp/Texinfo/Common.pm | 13 +++++++------
 tp/texi2any.pl       |  6 ++++--
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a4d608ac3d..3500c5ef18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-13  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm, tp/texi2any.pl: change in comments for a more
+       accurate description of duplicates in opened_files.
+
 2024-04-12  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Text.pm: change in comments.
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 291036aa41..d7d91a94ea 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -645,7 +645,6 @@ sub output_files_disable_output_encoding($$)
   $self->{'output_encoding_disabled'} = $no_output_encoding;
 }
 
-#
 # All the opened files are registered, except for stdout,
 # and the closing of files should be registered too with
 # output_files_register_closed() below.  This makes possible to
@@ -704,11 +703,13 @@ sub output_files_open_out($$$;$$)
       warn "BUG: already open: $file_path\n";
     } else {
       # FIXME check that this file has not already been registered
-      # as opened_file?  If not, it will be unlink'ed twice if the
-      # main program aborts.  It is not possible to use the file name
-      # twice except with user customization file name set to a file
-      # name also used for a specific purpose such as MACRO_EXPAND
-      # or the like, as output units files are never opened twice.
+      # as opened_file?  If not, it probably has been overwritten and
+      # will be unlink'ed twice if the main program aborts.
+      # It is not possible to use the file name twice in converters
+      # for regular output as files are only closed when all the output
+      # units have been written.  It could be possible in HTML with js
+      # scripts licence files set to the same name as an output unit, which
+      # is not possible in the default case.
       push @{$self->{'opened_files'}}, $file_path;
     }
     $self->{'unclosed_files'}->{$file_path} = $filehandle;
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index c8e0cf636b..53e13cc1e9 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1255,7 +1255,7 @@ sub _handle_errors($)
         my $file = $error_message->{'file_name'};
 
         if (get_conf('TEST')) {
-          # otherwise out of source build fail since the file names
+          # otherwise out of source build fails since the file names
           # are different
           my ($directories, $suffix);
           ($file, $directories, $suffix) = fileparse($file);
@@ -1598,10 +1598,10 @@ while(@input_files) {
     }
     push @opened_files, Texinfo::Common::output_files_opened_files(
                                       $macro_expand_files_information);
+
     # we do not need to go through unclosed files of
     # $macro_expand_files_information as we know that the file is
     # already closed if needed.
-
     if ($error_macro_expand_file) {
       $error_count++;
       _exit($error_count, \@opened_files);
@@ -1744,6 +1744,8 @@ while(@input_files) {
     }
   }
 
+  # FIXME it is unlikely, but possible that a file registered with
+  # MACRO_EXPAND is registered again in a converter
   push @opened_files, Texinfo::Common::output_files_opened_files(
                               $converter->output_files_information());
   handle_errors($converter_registrar->errors(), $error_count, \@opened_files);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]