summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/kpsewhich.c
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-25 07:36:00 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-25 07:36:00 +0000
commit8f37158e88f5a8ec913d12220b295dca907ed6b9 (patch)
treef7c4c387c2a1b866f693e1e1fdc22c3b2023f780 /Build/source/texk/kpathsea/kpsewhich.c
parentdce8da8c3072b543be8fb371e9060ad0a2d1c7c0 (diff)
kpathsea [win32]: Allow Unicode file name in kpsewhich, add new functions in knj.[ch]
git-svn-id: svn://tug.org/texlive/trunk@32783 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/kpsewhich.c')
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
index 4bcb77ac48b..59739e56c9c 100644
--- a/Build/source/texk/kpathsea/kpsewhich.c
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -30,6 +30,12 @@
#include <kpathsea/variable.h>
#include <kpathsea/version.h>
+#ifdef WIN32
+#undef fputs
+#undef puts
+#define fputs win32_fputs
+#define puts win32_puts
+#endif
/* For variable and path expansion. (-expand-var, -expand-path,
-show-path) */
@@ -672,6 +678,10 @@ kpathsea_set_program_enabled (kpse, fmt, false, kpse_src_cmdline - 1)
int
main (int argc, string *argv)
{
+#ifdef WIN32
+ string *av, enc;
+ int ac;
+#endif
unsigned unfound = 0;
kpathsea kpse = kpathsea_new();
@@ -679,6 +689,22 @@ main (int argc, string *argv)
read_command_line (kpse, argc, argv);
kpathsea_set_program_name (kpse, argv[0], progname);
+#ifdef WIN32
+ if(strstr(progname,"xetex") || strstr(progname,"xelatex")
+ || strstr(progname,"uptex") || strstr(progname,"uplatex")
+ || strstr(progname,"dvipdfm") || strstr(progname,"extractbb")
+ || strstr(progname,"xbb") || strstr(progname,"ebb")
+ || strstr(progname,"dvips"))
+ {
+ enc = kpathsea_var_value (kpse, "command_line_encoding");
+ if (get_command_line_args_utf8(enc, &ac, &av)) {
+ optind = 0;
+ read_command_line (kpse, ac, av);
+ argv = av;
+ argc = ac;
+ }
+ }
+#endif
init_more (kpse);