From cfae1fdf8a2e58edcf68f3a64e9caa75922e0e22 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 28 Jul 2011 08:51:08 +0000 Subject: kpathsea: More changes to reduce diffs with W32TeX git-svn-id: svn://tug.org/texlive/trunk@23256 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/expand.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'Build/source/texk/kpathsea/expand.c') diff --git a/Build/source/texk/kpathsea/expand.c b/Build/source/texk/kpathsea/expand.c index f1199559f17..453fa6d65ac 100644 --- a/Build/source/texk/kpathsea/expand.c +++ b/Build/source/texk/kpathsea/expand.c @@ -217,14 +217,36 @@ kpathsea_path_expand (kpathsea kpse, const_string path) string xpath; string elt; unsigned len; + const_string ypath; +#if defined(WIN32) + string zpath, p; +#endif /* Initialise ret to the empty string. */ ret = (string)xmalloc (1); *ret = 0; len = 0; +#if defined(WIN32) + zpath = xstrdup (path); + + for (p = zpath; *p; p++) + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + + ypath = zpath; +#else + ypath = path; +#endif + /* Expand variables and braces first. */ - xpath = kpathsea_brace_expand (kpse, path); + xpath = kpathsea_brace_expand (kpse, ypath); + +#if defined(WIN32) + free (zpath); +#endif /* Now expand each of the path elements, printing the results */ for (elt = kpathsea_path_element (kpse, xpath); elt; @@ -304,12 +326,6 @@ brace_expand (kpathsea kpse, const_string *text) result = str_list_init(); partial = str_list_init(); for (p = *text; *p && *p != '}'; ++p) { -#if defined(WIN32) - if (IS_KANJI(p)) { - p++; - continue; - } -#endif /* FIXME: Should be IS_ENV_SEP(*p) */ if (*p == ENV_SEP || *p == ',') { expand_append(&partial, *text, p); @@ -333,6 +349,10 @@ brace_expand (kpathsea kpse, const_string *text) if (*(p+1) == '{') for (p+=2; *p!='}';++p); } +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif } expand_append(&partial, *text, p); str_list_concat(&result, partial); -- cgit v1.2.3