summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/openclose.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-12-03 14:32:09 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-12-03 14:32:09 +0000
commit5b0be858da5f93a678e7665f67921f8e63559f5a (patch)
tree8fd7977521cfc2ed41d72c599ffc50330b50c0e0 /Build/source/texk/web2c/lib/openclose.c
parente12d9594464166e09a2127166d663cedbcd9a050 (diff)
Support KANJI file name in (e)upTeX and XeTeX on Windows (from T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32308 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib/openclose.c')
-rw-r--r--Build/source/texk/web2c/lib/openclose.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/openclose.c b/Build/source/texk/web2c/lib/openclose.c
index 2620b8894bd..35301b5187c 100644
--- a/Build/source/texk/web2c/lib/openclose.c
+++ b/Build/source/texk/web2c/lib/openclose.c
@@ -57,7 +57,11 @@ recorder_start(void)
recorder_name = temp;
}
+#if defined(WIN32)
+ recorder_file = fsyscp_xfopen(recorder_name, FOPEN_W_MODE);
+#else
recorder_file = xfopen(recorder_name, FOPEN_W_MODE);
+#endif
cwd = xgetcwd();
fprintf(recorder_file, "PWD %s\n", cwd);
@@ -101,7 +105,7 @@ recorder_change_filename (string new_name)
/* reopen the recorder file by FOPEN_A_MODE. */
#if defined(WIN32)
- recorder_file = fopen (recorder_name, FOPEN_A_MODE);
+ recorder_file = fsyscp_xfopen (recorder_name, FOPEN_A_MODE);
#endif
if (temp)
@@ -165,7 +169,11 @@ open_input (FILE **f_ptr, int filefmt, const_string fopen_mode)
them from there. We only look for the name as-is. */
if (output_directory && !kpse_absolute_p (nameoffile+1, false)) {
fname = concat3 (output_directory, DIR_SEP_STRING, nameoffile + 1);
+#if defined(WIN32)
+ *f_ptr = fsyscp_xfopen (fname, fopen_mode);
+#else
*f_ptr = fopen (fname, fopen_mode);
+#endif
if (*f_ptr) {
free (nameoffile);
namelength = strlen (fname);
@@ -182,7 +190,11 @@ open_input (FILE **f_ptr, int filefmt, const_string fopen_mode)
/* A negative FILEFMT means don't use a path. */
if (filefmt < 0) {
/* no_file_path, for BibTeX .aux files and MetaPost things. */
+#if defined(WIN32)
+ *f_ptr = fsyscp_xfopen(nameoffile + 1, fopen_mode);
+#else
*f_ptr = fopen(nameoffile + 1, fopen_mode);
+#endif
/* FIXME... fullnameoffile = xstrdup(nameoffile + 1); */
} else {
/* The only exception to `must_exist' being true is \openin, for
@@ -227,7 +239,11 @@ open_input (FILE **f_ptr, int filefmt, const_string fopen_mode)
*f_ptr = nkf_open (nameoffile + 1, fopen_mode);
} else
#endif
+#if defined(WIN32)
+ *f_ptr = fsyscp_xfopen (nameoffile + 1, fopen_mode);
+#else
*f_ptr = xfopen (nameoffile + 1, fopen_mode);
+#endif
}
}
}
@@ -275,7 +291,11 @@ open_output (FILE **f_ptr, const_string fopen_mode)
}
/* Is the filename openable as given? */
+#if defined(WIN32)
+ *f_ptr = fsyscp_xfopen (fname, fopen_mode);
+#else
*f_ptr = fopen (fname, fopen_mode);
+#endif
if (!*f_ptr) {
/* Can't open as given. Try the envvar. */