texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/Texinfo Common.pm Parser.pm Convert/...


From: Patrice Dumas
Subject: texinfo/tp/Texinfo Common.pm Parser.pm Convert/...
Date: Sun, 13 Nov 2011 23:32:49 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/11/13 23:32:49

Modified files:
        tp/Texinfo     : Common.pm Parser.pm 
        tp/Texinfo/Convert: HTML.pm 

Log message:
        Close files parsed (css files and texinfo files).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.333&r2=1.334
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.207&r2=1.208

Patches:
Index: Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- Common.pm   13 Nov 2011 23:04:30 -0000      1.96
+++ Common.pm   13 Nov 2011 23:32:48 -0000      1.97
@@ -770,6 +770,7 @@
 
   if ($file eq '-') {
     binmode(STDOUT, ":encoding($encoding)") if ($encoding);
+    push @{$self->{'opened_files'}}, $file if ($self);
     return \*STDOUT;
   }
   my $filehandle = do { local *FH };

Index: Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -b -r1.333 -r1.334
--- Parser.pm   11 Nov 2011 15:16:09 -0000      1.333
+++ Parser.pm   13 Nov 2011 23:32:48 -0000      1.334
@@ -1723,7 +1723,14 @@
         }
       }
     }
-    shift(@{$self->{'input'}});
+    my $previous_input = shift(@{$self->{'input'}});
+    if ($previous_input->{'fh'}) {
+      if (!close($previous_input->{'fh'})) {
+        $self->document_warn(sprintf($self->__("Error on closing %s: %s"),
+                                     $previous_input->{'name'}, $!));
+
+      }
+    }
   }
 
   return (undef, $line_nr);

Index: Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -b -r1.207 -r1.208
--- Convert/HTML.pm     13 Nov 2011 23:04:30 -0000      1.207
+++ Convert/HTML.pm     13 Nov 2011 23:32:49 -0000      1.208
@@ -4475,7 +4475,7 @@
   #file_line_warn (__("address@hidden not finished in css file"), $file)  if 
($in_import and !$in_comment and !$in_string);
   warn (sprintf($self->__("%s:%d: string not closed in css file"), 
                 $file, $line_nr)) if ($in_string);
-  warn (sprintf($self->__("%s:%d: --css-file ended in comment"), 
+  warn (sprintf($self->__("%s:%d: --css-include ended in comment"), 
                 $file, $line_nr)) if ($in_comment);
   warn (sprintf($self->__("%s:%d address@hidden not finished in css file"), 
         $file, $line_nr)) 
@@ -4506,9 +4506,10 @@
                $self->__("css file %s not found"), $file));
         next;
       }
-      unless (open (CSSFILE, "$css_file")) {
+      # FIXME use open_out?
+      unless (open (CSSFILE, $css_file)) {
         $self->document_warn (sprintf($self->__(
-             "could not open --css-file %s: %s"), 
+             "could not open --include-file %s: %s"), 
               $css_file, $!));
         next;
       }
@@ -4517,6 +4518,10 @@
     my ($import_lines, $rules_lines);
     ($import_lines, $rules_lines) 
       = $self->_process_css_file ($css_file_fh, $css_file);
+    if (!close($css_file_fh)) {
+      $self->document_warn(sprintf($self->__("Error on closing CSS file %s: 
%s"),
+                                   $css_file, $!));
+    }
     push @css_import_lines, @$import_lines;
     push @css_rule_lines, @$rules_lines;
 



reply via email to

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