diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-01-13 12:49:44 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-01-13 12:49:44 +0000 |
commit | eccd36a335c0a58d592bc22120784f58a15f5801 (patch) | |
tree | 388c7849ad419e6f83462041b5677e96b91fdcac /Build | |
parent | ddec8a038b04d13b12eccfa71bd24b78967dd8c5 (diff) |
Allow Unicode file names in dvips on Windows (Windows only, from T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32651 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/dvips.c | 38 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/output.c | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/resident.c | 3 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/search.c | 8 |
5 files changed, 63 insertions, 0 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index c037711d5f3..b63d3c9b37c 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,10 @@ +2014-01-13 TANAKA Takuji <KXD02663@nifty.ne.jp> + + * dvips.c, resident.c: Allow multibyte string with 0x5c + in CP932-like system. (Windows only) + * dvips.c, output.c, search.c: Allow Unicode file names. + (Windows only) + 2013-09-16 Karl Berry <karl@tug.org> * writet1.c: formatting tweaks. diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c index e2be8c62948..a6dd4bb8add 100644 --- a/Build/source/texk/dvipsk/dvips.c +++ b/Build/source/texk/dvipsk/dvips.c @@ -8,6 +8,7 @@ #include <kpathsea/progname.h> #include <kpathsea/tex-hush.h> #include <kpathsea/tex-make.h> +#include <kpathsea/variable.h> #include <kpathsea/version.h> #include <kpathsea/lib.h> #ifdef strdup @@ -47,6 +48,11 @@ extern char *strtok(); /* some systems don't have this in strings.h */ #include <sys/resource.h> #endif +#if defined(WIN32) && defined(KPATHSEA) +#undef fopen +#define fopen(file, fmode) fsyscp_fopen(file, fmode) +#endif + #ifndef DEFRES #define DEFRES (600) #endif @@ -523,6 +529,10 @@ newoutname(void) { seqptr = p + 1; else if (IS_DIR_SEP (*p)) seqptr = 0; +#ifdef WIN32 + else if (IS_KANJI(p)) + p++; +#endif if (seqptr == 0) seqptr = p; nextstring += 5; /* make room for the number, up to five digits */ @@ -566,6 +576,11 @@ queryargs(void) qargv[qargc] = (char *)NULL; } +#if defined(KPATHSEA) && defined(WIN32) +int argc; +char **argv; +#endif + /* * Finally, our main routine. */ @@ -573,8 +588,12 @@ queryargs(void) main(void) #else int +#if defined(KPATHSEA) && defined(WIN32) +main(int ac, char **av) +#else main(int argc, char **argv) #endif +#endif { int i, lastext = -1; #ifdef MVSXA @@ -583,6 +602,11 @@ main(int argc, char **argv) sectiontype *sects; #ifdef WIN32 +#if defined(KPATHSEA) + char *enc; + argc=ac; + argv=av; +#endif SET_BINARY(fileno(stdin)); SET_BINARY(fileno(stdout)); #endif @@ -596,6 +620,10 @@ main(int argc, char **argv) #ifdef KPATHSEA kpse_set_program_name (argv[0], "dvips"); kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile); +#ifdef WIN32 + enc = kpse_var_value("command_line_encoding"); + get_command_line_args_utf8(enc, &argc, &argv); +#endif #endif #ifdef __THINK__ @@ -1088,6 +1116,12 @@ default: lastext = nextstring - iname; else if (IS_DIR_SEP(*nextstring)) lastext = 0; +#ifdef WIN32 + else if (IS_KANJI(p-1)) { + nextstring++; + *nextstring = *p++; + } +#endif nextstring++; } *nextstring++ = '.'; @@ -1244,6 +1278,10 @@ default: for (oname=p; *p && p[1]; p++) if (IS_DIR_SEP(*p)) oname = p + 1; +#ifdef WIN32 + else if (IS_KANJI(p)) + p++; +#endif } } #ifdef DEBUG diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c index ae5cf86b29f..d3ca9cf69ab 100644 --- a/Build/source/texk/dvipsk/output.c +++ b/Build/source/texk/dvipsk/output.c @@ -16,6 +16,13 @@ #define pclose(pstream) _pclose(pstream) #endif #endif +#if defined(WIN32) && defined(KPATHSEA) +#undef fopen +#undef popen +#define fopen(file, fmode) fsyscp_fopen(file, fmode) +#define popen(pcmd, pmode) fsyscp_popen(pcmd, pmode) +#define pclose(pstream) _pclose(pstream) +#endif #ifdef __DJGPP__ #include <unistd.h> /* for `isatty' */ diff --git a/Build/source/texk/dvipsk/resident.c b/Build/source/texk/dvipsk/resident.c index 9fca17b56c8..2212fe7b554 100644 --- a/Build/source/texk/dvipsk/resident.c +++ b/Build/source/texk/dvipsk/resident.c @@ -343,6 +343,9 @@ getdefaults(const char *s) *q = DIR_SEP; p++; q++; while (*p && IS_DIR_SEP(*p)) p++; } + else if (IS_KANJI(p)) { + *q++ = *p++; + } *q = *p; } *q = '\0'; diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c index 7ef93ba5d36..e3c7e4ff2c1 100644 --- a/Build/source/texk/dvipsk/search.c +++ b/Build/source/texk/dvipsk/search.c @@ -20,6 +20,14 @@ #include <kpathsea/c-pathch.h> #include <kpathsea/variable.h> +#ifdef WIN32 +#undef fopen +#undef popen +#define fopen(file, fmode) fsyscp_fopen(file, fmode) +#define popen(pcmd, pmode) fsyscp_popen(pcmd, pmode) +#define pclose(pstream) _pclose(pstream) +#endif + #ifndef GUNZIP #define GUNZIP "gzip -d" #endif |