summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/expand.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-28 08:51:08 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-28 08:51:08 +0000
commitcfae1fdf8a2e58edcf68f3a64e9caa75922e0e22 (patch)
treeb34b92941b15a57c2f8c29208ffa9aca4134e4ac /Build/source/texk/kpathsea/expand.c
parentce679aa3ad2f099253cf4266614a3cf7164d4dcd (diff)
kpathsea: More changes to reduce diffs with W32TeX
git-svn-id: svn://tug.org/texlive/trunk@23256 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/expand.c')
-rw-r--r--Build/source/texk/kpathsea/expand.c34
1 files changed, 27 insertions, 7 deletions
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);