summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-01 17:55:44 +0000
committerKarl Berry <karl@freefriends.org>2018-02-01 17:55:44 +0000
commit4ee655e7ae033901bf8b6c959fd72bdaf444aff7 (patch)
treea1338b8bfb88f1af5a16a12e0325cb1c06b50fc6 /Build
parentf0b4f93decd9f9bf1a8b070777a6492ea8d5d496 (diff)
KPSE_CNF_P convenience macro
git-svn-id: svn://tug.org/texlive/trunk@46512 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6
-rw-r--r--Build/source/texk/kpathsea/lib.h6
-rw-r--r--Build/source/texk/kpathsea/tex-file.c4
3 files changed, 13 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 52b4e79b673..1feb2ffbb0c 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-01 Karl Berry <karl@freefriends.org>
+
+ * lib.h (KPSE_CNF_P): new macro.
+ * tex-file.c (kpathsea_find_file_generic): use it,
+ for try_std_extension_first.
+
2018-01-27 Karl Berry <karl@freefriends.org>
* readable.h: doc fixes.
diff --git a/Build/source/texk/kpathsea/lib.h b/Build/source/texk/kpathsea/lib.h
index 8c1f8e1ecc4..df380f654d6 100644
--- a/Build/source/texk/kpathsea/lib.h
+++ b/Build/source/texk/kpathsea/lib.h
@@ -122,6 +122,12 @@ extern "C" {
/* If the environment variable TEST is set, return it; otherwise,
DEFAULT. This is useful for paths that use more than one envvar. */
#define ENVVAR(test, default) (getenv (test) ? (test) : (default))
+
+/* Return whether a kpse configuration is (some sort of) true. Check
+ for negation values, so a value like "2" will be true, just in case. */
+#define KPSE_CNF_P(val) \
+ ((val) && *(val) && *(val) != 'f' && *(val) != '0')
+
/* Return a fresh copy of S1 followed by S2, et al. */
extern KPSEDLL string concat (const_string s1, const_string s2);
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index f11753e6244..626e240b82d 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -1079,9 +1079,7 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name,
try_std_extension_first
= kpathsea_var_value (kpse, "try_std_extension_first");
- if (has_any_suffix /* xxx && ! KPSE_CNF_VALUE_P (try_std_extension_first)*/
- && (try_std_extension_first == NULL || *try_std_extension_first == 'f'
- || *try_std_extension_first == '0')) {
+ if (has_any_suffix && !KPSE_CNF_P (try_std_extension_first)) {
target_asis_name (kpse, &target, &count, format, name, use_fontmaps,
has_potential_suffix, has_any_suffix);
target_suffixed_names (kpse, &target, &count, format, name, use_fontmaps,