texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Wed, 14 Sep 2022 01:50:47 -0400 (EDT)

branch: master
commit 2aa9175daabb9330e62da61c806ba07bfde89cb0
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Sep 14 07:50:32 2022 +0200

    * tp/Texinfo/Common.pm (locate_include_file): avoid a call to
    get_conf.  Reindent, change variable names.
---
 ChangeLog            |  5 +++++
 tp/Texinfo/Common.pm | 23 ++++++++++-------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b810759dc3..ed60b44bf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-09-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (locate_include_file): avoid a call to
+       get_conf.  Reindent, change variable names.
+
 2022-09-14  Gavin Smith  <gavinsmith0123@gmail.com>
 
        No italic correction for code @var
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 26bf6c59a0..72c93ca934 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1599,24 +1599,27 @@ sub locate_include_file($$)
 
   my $found_file;
   if ($ignore_include_directories) {
-    $found_file = $input_file_path if (-e $input_file_path and -r 
$input_file_path);
+    $found_file = $input_file_path
+         if (-e $input_file_path and -r $input_file_path);
   } else {
-    my @dirs;
+    my @include_directories;
     if ($customization_information
         and $customization_information->get_conf('INCLUDE_DIRECTORIES')) {
-      @dirs = @{$customization_information->get_conf('INCLUDE_DIRECTORIES')};
+      @include_directories
+         = @{$customization_information->get_conf('INCLUDE_DIRECTORIES')};
     } else {
       # no object with directory list and not an absolute path, never succeed
       return undef;
     }
-    foreach my $include_dir 
(@{$customization_information->get_conf('INCLUDE_DIRECTORIES')}) {
-      my ($include_volume, $include_directories, $include_filename)
+    foreach my $include_dir (@include_directories) {
+      my ($include_volume, $include_dir_path, $include_filename)
          = File::Spec->splitpath($include_dir, 1);
       
       my $possible_file = File::Spec->catpath($include_volume,
-        File::Spec->catdir(File::Spec->splitdir($include_directories),
+        File::Spec->catdir(File::Spec->splitdir($include_dir_path),
                            @directories), $filename);
-      $found_file = "$possible_file" if (-e "$possible_file" and -r 
"$possible_file");
+      $found_file = $possible_file
+           if (-e $possible_file and -r $possible_file);
       last if (defined($found_file));
     }
   }
@@ -1974,12 +1977,6 @@ sub count_bytes($$;$)
     #print STDERR "Count($length): $string\n";
     #return $length;
   }
-  # FIXME is the following required for correct count of end of lines?
-  #if ($encoding) {
-  #  return length(Encode::encode($encoding, $string));
-  #} else {
-  #  return length(Encode::encode('ascii', $string));
-  #}
 }
 
 # custom heading command line is split at @|



reply via email to

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