summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/elt-dirs.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-12-01 16:06:38 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-12-01 16:06:38 +0000
commit4813cb6776a1c73bf8e5fea4eec861bb5aec7467 (patch)
treeb1964c427038c0a35c6af569d039417f3d310034 /Build/source/texk/kpathsea/elt-dirs.c
parentd1f96f6033d08c0e712307ddc9bc1f63a8540742 (diff)
Support KANJI file name in (e)upTeX on Windows (T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32290 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/elt-dirs.c')
-rw-r--r--Build/source/texk/kpathsea/elt-dirs.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Build/source/texk/kpathsea/elt-dirs.c b/Build/source/texk/kpathsea/elt-dirs.c
index 7d61d850086..271b693b5dc 100644
--- a/Build/source/texk/kpathsea/elt-dirs.c
+++ b/Build/source/texk/kpathsea/elt-dirs.c
@@ -104,7 +104,9 @@ static void expand_elt (kpathsea, str_llist_type *, string, unsigned);
#ifdef WIN32
/* Shared across recursive calls, it acts like a stack. */
-static char dirname[MAX_PATH];
+static char dirname[MAX_PATH*2];
+static wchar_t dirnamew[MAX_PATH];
+static char *potname;
#endif
static void
@@ -131,7 +133,8 @@ do_subdir (kpathsea kpse, str_llist_type *str_list_ptr, string elt,
#if defined (WIN32)
strcpy(dirname, FN_STRING(name));
strcat(dirname, "/*.*"); /* "*.*" or "*" -- seems equivalent. */
- hnd = FindFirstFile(dirname, &find_file_data);
+ get_wstring_from_fsyscp(dirname, dirnamew);
+ hnd = FindFirstFileW(dirnamew, &find_file_data);
if (hnd == INVALID_HANDLE_VALUE) {
fn_free(&name);
@@ -151,11 +154,13 @@ do_subdir (kpathsea kpse, str_llist_type *str_list_ptr, string elt,
}
proceed = 1;
while (proceed) {
- if (find_file_data.cFileName[0] != '.') {
+ if (find_file_data.cFileName[0] != L'.') {
int links;
/* Construct the potential subdirectory name. */
- fn_str_grow (&name, find_file_data.cFileName);
+ potname = get_fsyscp_from_wstring(find_file_data.cFileName, potname=NULL);
+ fn_str_grow (&name, potname);
+ free(potname);
/* Maybe we have cached the leafness of this directory.
The function will return 0 if unknown,
@@ -197,7 +202,7 @@ do_subdir (kpathsea kpse, str_llist_type *str_list_ptr, string elt,
}
fn_shrink_to (&name, elt_length);
}
- proceed = FindNextFile (hnd, &find_file_data);
+ proceed = FindNextFileW (hnd, &find_file_data);
}
/* Update the leafness of name. */
kpathsea_dir_links(kpse, FN_STRING(name), nlinks);