texlive[65129] Build/source/texk/kpathsea/win32/mktexfmt.c: update

commits+kakuto at tug.org commits+kakuto at tug.org
Mon Nov 28 07:54:31 CET 2022


Revision: 65129
          http://tug.org/svn/texlive?view=revision&revision=65129
Author:   kakuto
Date:     2022-11-28 07:54:31 +0100 (Mon, 28 Nov 2022)
Log Message:
-----------
update mktexfmt.c for windows

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/win32/mktexfmt.c

Modified: trunk/Build/source/texk/kpathsea/win32/mktexfmt.c
===================================================================
--- trunk/Build/source/texk/kpathsea/win32/mktexfmt.c	2022-11-28 06:49:21 UTC (rev 65128)
+++ trunk/Build/source/texk/kpathsea/win32/mktexfmt.c	2022-11-28 06:54:31 UTC (rev 65129)
@@ -1,6 +1,6 @@
 /* mktexfmt.c
 
-   Copyright 2000, 2017 Akira Kakuto.
+   Copyright 2000, 2022 Akira Kakuto.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -21,7 +21,7 @@
 */
 #include <kpathsea/kpathsea.h>
 
-#define VERSION "0.2"
+#define VERSION "0.3"
 
 int main(int ac, char **av)
 {
@@ -50,12 +50,14 @@
   p = kpse_program_name;
   if(ac != 2) {
     fprintf(stderr,"%s : Usage %s formatname\n", p, p);
-    fprintf(stderr,"formatname :  (foo.fmt, foo.base, foo.mem)\n");
+    fprintf(stderr,"formatname :  foo.fmt, foo.base\n");
+    fprintf(stderr,"              extension can be omitted\n");
     return 1;
   }
   if(!strncmp(av[1], "-h", 2) || !strncmp(av[1], "--h", 3)) {
     fprintf(stderr,"%s : Usage %s formatname\n", p, p);
-    fprintf(stderr,"formatname :  (foo.fmt, foo.base, foo.mem)\n");
+    fprintf(stderr,"formatname :  foo.fmt, foo.base\n");
+    fprintf(stderr,"              extension can be omitted\n");
     return 0;
   }
   if(!strncmp(av[1], "-v", 2) || !strncmp(av[1], "--v", 3)) {
@@ -83,17 +85,15 @@
   strcpy(orgname, av[1]);
 
   p = strrchr(av[1], '.');
-  if(!p) {
-    fprintf(stderr, "formatname needs a suffix.\n");
-    return 1;
-  }
 
-  if(stricmp(p, ".fmt") && stricmp(p, ".base") && stricmp(p, ".mem")) {
-    fprintf(stderr, "%s : unknown format type.\n", av[1]);
-    return 1;
-  }
+  if (p) {
+    if(stricmp(p, ".fmt") && stricmp(p, ".base") && stricmp(p, ".mem")) {
+      fprintf(stderr, "%s : unknown format type.\n", av[1]);
+      return 1;
+    }
 
   *p = '\0';
+  }
 
 /* save stdout and stdin */
   savo = _dup(fileno(stdout));
@@ -131,10 +131,5 @@
 /* close nul device */
   fclose(fnul);
 
-  fmtname = kpse_find_file(orgname , kpse_fmt_format, 0);
-  if(fmtname) {
-    printf("%s\n", fmtname);
-    free(fmtname);
-  }
   return 0;
 }



More information about the tex-live-commits mailing list.