summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/win32
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/kpathsea/win32')
-rw-r--r--Build/source/texk/kpathsea/win32/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/win32/mktexfmt.c35
2 files changed, 29 insertions, 10 deletions
diff --git a/Build/source/texk/kpathsea/win32/ChangeLog b/Build/source/texk/kpathsea/win32/ChangeLog
index 5b8013f4543..e164530fff9 100644
--- a/Build/source/texk/kpathsea/win32/ChangeLog
+++ b/Build/source/texk/kpathsea/win32/ChangeLog
@@ -1,3 +1,7 @@
+2017-06-04 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * mktexfmt.c: Adapt to the new fmtutil.pl in TeX Live.
+
2016-04-06 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* All *.c, *.h files: Copyright year 2016.
diff --git a/Build/source/texk/kpathsea/win32/mktexfmt.c b/Build/source/texk/kpathsea/win32/mktexfmt.c
index ac400b54ab6..04a5c4acc5a 100644
--- a/Build/source/texk/kpathsea/win32/mktexfmt.c
+++ b/Build/source/texk/kpathsea/win32/mktexfmt.c
@@ -1,6 +1,6 @@
/* mktexfmt.c
- Copyright 2000, 2016 Akira Kakuto.
+ Copyright 2000, 2017 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.1"
+#define VERSION "0.2"
int main(int ac, char **av)
{
@@ -34,17 +34,28 @@ int main(int ac, char **av)
char texbindir[256];
char fullbin[256];
+ int is_w32tex;
+
kpse_set_program_name(av[0], NULL);
+ p = kpse_var_value("jtex_filetype");
+
+ if (p) {
+ is_w32tex = 1;
+ free(p);
+ } else {
+ is_w32tex = 0;
+ }
+
p = kpse_program_name;
if(ac != 2) {
fprintf(stderr,"%s : Usage %s formatname\n", p, p);
- fprintf(stderr,"formatname : (foo.fmt, foo.nfmt, foo.mem, foo.base)\n");
+ fprintf(stderr,"formatname : (foo.fmt, foo.base, foo.mem)\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.nfmt, foo.mem, foo.base)\n");
+ fprintf(stderr,"formatname : (foo.fmt, foo.base, foo.mem)\n");
return 0;
}
if(!strncmp(av[1], "-v", 2) || !strncmp(av[1], "--v", 3)) {
@@ -77,8 +88,7 @@ int main(int ac, char **av)
return 1;
}
- if(stricmp(p, ".fmt") && stricmp(p, ".nfmt") &&
- stricmp(p, ".base") && stricmp(p, ".mem")) {
+ if(stricmp(p, ".fmt") && stricmp(p, ".base") && stricmp(p, ".mem")) {
fprintf(stderr, "%s : unknown format type.\n", av[1]);
return 1;
}
@@ -101,10 +111,15 @@ int main(int ac, char **av)
/* COMMAND */
strcpy(fullbin, texbindir);
- strcat(fullbin, "fmtutil.exe");
- fprintf(stderr, "Running the command %s\n", fullbin);
- _spawnlp(_P_WAIT, fullbin, "fmtutil", "--byfmt", av[1], NULL);
-
+ if (is_w32tex) {
+ strcat(fullbin, "fmtutil.exe");
+ fprintf(stderr, "Running the command %s\n", fullbin);
+ _spawnlp(_P_WAIT, fullbin, "fmtutil", "--byfmt", av[1], NULL);
+ } else {
+ strcat(fullbin, "fmtutil-sys.exe");
+ fprintf(stderr, "Running the command %s\n", fullbin);
+ _spawnlp(_P_WAIT, fullbin, "fmtutil-sys", "--byfmt", av[1], NULL);
+ }
/* END COMMAND */
/* return to original stdout and stdin */