texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Common.pm (locate_include_file): rem


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (locate_include_file): remove comments, move code to where the variables are used.
Date: Sun, 15 Dec 2024 14:21:59 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 20ce7e8b6c * tp/Texinfo/Common.pm (locate_include_file): remove 
comments, move code to where the variables are used.
20ce7e8b6c is described below

commit 20ce7e8b6cc3a89548d40d95fa0bd1eaf3887b12
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 15 20:21:52 2024 +0100

    * tp/Texinfo/Common.pm (locate_include_file): remove comments, move
    code to where the variables are used.
---
 ChangeLog            |  5 +++++
 tp/Texinfo/Common.pm | 19 ++++---------------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6c135168bc..ab40acaab9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-12-15  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (locate_include_file): remove comments, move
+       code to where the variables are used.
+
 2024-12-15  Patrice Dumas  <pertusus@free.fr>
 
        Unconditionally use / as directory separator
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 34df538e03..647df0a778 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1101,15 +1101,15 @@ sub locate_include_file($;$)
 
   my $ignore_include_directories = 0;
 
-  my ($volume, $directories, $filename)
-     = File::Spec->splitpath($input_file_path);
-  my @directories = File::Spec->splitdir($directories);
-
   # If the path is absolute or begins with . or .., do not search in
   # include directories.  This is consistent with Kpathsea for Texinfo TeX.
   if (File::Spec->file_name_is_absolute($input_file_path)) {
     $ignore_include_directories = 1;
   } else {
+    my ($volume, $directories, $filename)
+      = File::Spec->splitpath($input_file_path);
+    my @directories = File::Spec->splitdir($directories);
+
     foreach my $dir (@directories) {
       if ($dir eq File::Spec->updir() or $dir eq File::Spec->curdir()) {
         $ignore_include_directories = 1;
@@ -1130,17 +1130,6 @@ sub locate_include_file($;$)
       return undef;
     }
     foreach my $include_dir (@$include_directories) {
-      #my ($include_volume, $include_dir_path, $include_filename)
-      #   = File::Spec->splitpath($include_dir, 1);
-
-      # catpath/catdir remove leading . and remove empty directories
-      # within paths.  To be more like XS/C output, we do it more simply
-      #my $possible_file = File::Spec->catpath($include_volume,
-      #  File::Spec->catdir(File::Spec->splitdir($include_dir_path),
-      #                     @directories), $filename);
-      #my $filepath = $directories . $filename;
-      #my $possible_file = File::Spec->catpath($include_volume,
-      #                $include_dir_path, $filepath);
       my $possible_file = "$include_dir/$input_file_path";
       if (-e $possible_file and -r $possible_file) {
         return $possible_file;



reply via email to

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