texlive[49319] Build/source/texk/kpathsea: fewer #ifdef WIN32

commits+karl at tug.org commits+karl at tug.org
Wed Dec 5 00:28:30 CET 2018


Revision: 49319
          http://tug.org/svn/texlive?view=revision&revision=49319
Author:   karl
Date:     2018-12-05 00:28:30 +0100 (Wed, 05 Dec 2018)
Log Message:
-----------
fewer #ifdef WIN32

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/ChangeLog
    trunk/Build/source/texk/kpathsea/kpsewhich.c

Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog	2018-12-04 23:10:56 UTC (rev 49318)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2018-12-04 23:28:30 UTC (rev 49319)
@@ -1,3 +1,8 @@
+2018-12-04  Karl Berry  <karl at freefriends.org>
+
+	* kpsewhich.c (main) [WIN32]: #define puts kpathsea_win32_puts
+	once, instead of many #ifdefs throughout function.
+
 2018-11-23  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* elt-dirs.c, knj.c, progname.c: Support non-ascii values

Modified: trunk/Build/source/texk/kpathsea/kpsewhich.c
===================================================================
--- trunk/Build/source/texk/kpathsea/kpsewhich.c	2018-12-04 23:10:56 UTC (rev 49318)
+++ trunk/Build/source/texk/kpathsea/kpsewhich.c	2018-12-04 23:28:30 UTC (rev 49319)
@@ -767,9 +767,10 @@
 main (int argc,  string *argv)
 {
 #ifdef WIN32
+#define puts kpathsea_win32_puts
   string *av, enc;
   int ac;
-#endif
+#endif /* WIN32 */
   unsigned unfound = 0;
   kpathsea kpse = kpathsea_new();
 
@@ -796,7 +797,7 @@
       argc = ac;
     }
   }
-#endif
+#endif /* WIN32 */
   init_more (kpse);
 
 
@@ -804,38 +805,24 @@
 
   /* Variable expansion.  */
   if (var_to_expand)
-#ifdef WIN32
-    kpathsea_win32_puts (kpse, kpathsea_var_expand (kpse, var_to_expand));
-#else
     puts (kpathsea_var_expand (kpse, var_to_expand));
-#endif
 
   /* Brace expansion. */
   if (braces_to_expand)
-#ifdef WIN32
-    kpathsea_win32_puts (kpse, kpathsea_brace_expand (kpse, braces_to_expand));
-#else
     puts (kpathsea_brace_expand (kpse, braces_to_expand));
-#endif
 
   /* Path expansion. */
   if (path_to_expand)
-#ifdef WIN32
-    kpathsea_win32_puts (kpse, kpathsea_path_expand (kpse, path_to_expand));
-#else
     puts (kpathsea_path_expand (kpse, path_to_expand));
-#endif
 
   /* Show a search path. */
   if (path_to_show) {
     if (user_format != kpse_last_format) {
-      if (!kpse->format_info[user_format].type) /* needed if arg was numeric */
+      if (!kpse->format_info[user_format].type) {
+        /* needed if arg was numeric */
         kpathsea_init_format (kpse, user_format);
-#ifdef WIN32
-      kpathsea_win32_puts (kpse, kpse->format_info[user_format].path);
-#else
+      }
       puts (kpse->format_info[user_format].path);
-#endif
     } else {
       WARNING ("kpsewhich: Cannot show path for unknown file type");
     }
@@ -848,11 +835,7 @@
       unfound++;
       value = "";
     }
-#ifdef WIN32
-    kpathsea_win32_puts (kpse, value);
-#else
     puts (value);
-#endif
   }
 
   if (safe_in_name) {



More information about the tex-live-commits mailing list