[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Wed, 31 Jan 2024 16:37:34 -0500 (EST) |
branch: master
commit 1afb982be0e6fd92631c86153db3ea34f46a6c52
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Jan 31 21:52:55 2024 +0100
* tp/Texinfo/Common.pm (locate_include_file): simplify code.
---
ChangeLog | 4 ++++
tp/Texinfo/Common.pm | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index de0fb449db..653b8b5f59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-01-31 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Common.pm (locate_include_file): simplify code.
+
2024-01-31 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_end_line_misc_line): check if
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index fe876a718c..4ccb57e271 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1188,10 +1188,10 @@ 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);
+ if (-e $input_file_path and -r $input_file_path) {
+ return $input_file_path;
+ }
} else {
my @include_directories;
if ($customization_information
@@ -1209,12 +1209,12 @@ sub locate_include_file($$)
my $possible_file = File::Spec->catpath($include_volume,
File::Spec->catdir(File::Spec->splitdir($include_dir_path),
@directories), $filename);
- $found_file = $possible_file
- if (-e $possible_file and -r $possible_file);
- last if (defined($found_file));
+ if (-e $possible_file and -r $possible_file) {
+ return $possible_file;
+ }
}
}
- return $found_file;
+ return undef;
}
# TODO document?