diff options
author | Takuji Tanaka <KXD02663@nifty.ne.jp> | 2017-06-23 14:55:46 +0000 |
---|---|---|
committer | Takuji Tanaka <KXD02663@nifty.ne.jp> | 2017-06-23 14:55:46 +0000 |
commit | 38f8f5eed5786ef6d79867ad9c82f224d46c640a (patch) | |
tree | 7ada1b7e3720a9c991e0bc5a4eb340640622bffa /Build/source/texk/dvidvi/dvidvi.c | |
parent | 25a27b4b95bc9c08f15b37371d23956f6faf2dd7 (diff) |
texk/dvidvi [Windows]: Allow Unicode file names
git-svn-id: svn://tug.org/texlive/trunk@44675 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvidvi/dvidvi.c')
-rw-r--r-- | Build/source/texk/dvidvi/dvidvi.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Build/source/texk/dvidvi/dvidvi.c b/Build/source/texk/dvidvi/dvidvi.c index 26f7433dd42..fb769fabc25 100644 --- a/Build/source/texk/dvidvi/dvidvi.c +++ b/Build/source/texk/dvidvi/dvidvi.c @@ -73,6 +73,14 @@ void error(const char *); #endif #include <kpathsea/c-pathch.h> #define PATHSEP ENV_SEP +#ifdef WIN32 +#include <kpathsea/config.h> +#include <kpathsea/variable.h> +#undef fopen +#undef fprintf +#define fopen fsyscp_fopen +#define fprintf win32_fprintf +#endif #else /* not KPATHSEA */ #if defined(__TOS__) #define READBIN "rb" /* TOS must use binary mode */ @@ -169,6 +177,16 @@ int prettycolumn ; /* the column we are at when running pretty */ int ptexdvi ; /* true if dvi file is extended (TATEKUMI) */ #endif +#ifdef WIN32 +void win32_fprintf(FILE *fp, const char *fmt, ...) { + va_list argp; + + va_start(argp, fmt); + win32_vfprintf(fp, fmt, argp); + va_end(argp); +} +#endif + /* * This array holds values that indicate the length of a command, if * we aren't concerned with that command (which is most of them) or @@ -1241,6 +1259,16 @@ static void writedvifile(void) { } int main(int argc, char *argv[]) { +#if defined(WIN32) && defined(KPATHSEA) + int ac; + char **av, *enc; + kpse_set_program_name(argv[0], "dvidvi"); + enc = kpse_var_value("command_line_encoding"); + if (get_command_line_args_utf8(enc, &ac, &av)) { + argc = ac; + argv = av; + } +#endif processargs(argc, argv) ; readdvifile() ; writedvifile() ; |