texlive[46512] Build/source/texk/kpathsea: KPSE_CNF_P convenience

commits+karl at tug.org commits+karl at tug.org
Thu Feb 1 18:55:45 CET 2018


Revision: 46512
          http://tug.org/svn/texlive?view=revision&revision=46512
Author:   karl
Date:     2018-02-01 18:55:44 +0100 (Thu, 01 Feb 2018)
Log Message:
-----------
KPSE_CNF_P convenience macro

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/ChangeLog
    trunk/Build/source/texk/kpathsea/lib.h
    trunk/Build/source/texk/kpathsea/tex-file.c

Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog	2018-02-01 01:23:08 UTC (rev 46511)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2018-02-01 17:55:44 UTC (rev 46512)
@@ -1,3 +1,9 @@
+2018-02-01  Karl Berry  <karl at 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 at freefriends.org>
 
 	* readable.h: doc fixes.

Modified: trunk/Build/source/texk/kpathsea/lib.h
===================================================================
--- trunk/Build/source/texk/kpathsea/lib.h	2018-02-01 01:23:08 UTC (rev 46511)
+++ trunk/Build/source/texk/kpathsea/lib.h	2018-02-01 17:55:44 UTC (rev 46512)
@@ -122,6 +122,12 @@
 /* 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);

Modified: trunk/Build/source/texk/kpathsea/tex-file.c
===================================================================
--- trunk/Build/source/texk/kpathsea/tex-file.c	2018-02-01 01:23:08 UTC (rev 46511)
+++ trunk/Build/source/texk/kpathsea/tex-file.c	2018-02-01 17:55:44 UTC (rev 46512)
@@ -1079,9 +1079,7 @@
   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,



More information about the tex-live-commits mailing list