diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-03 08:59:18 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-03 08:59:18 +0000 |
commit | 796b20394952986311b3b4152fe2107fd231a91f (patch) | |
tree | 8a1be73418dc7b124a351407479339dbe1e59e36 /Build/source/texk/kpathsea/kpsewhich.c | |
parent | 7a45d185107fc4233563feae433438ac25bc8b8c (diff) |
kpathsea: More changes to reduce diffs with W32TeX
git-svn-id: svn://tug.org/texlive/trunk@23364 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/kpsewhich.c')
-rw-r--r-- | Build/source/texk/kpathsea/kpsewhich.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c index 7c453bc8eb0..e0045d36080 100644 --- a/Build/source/texk/kpathsea/kpsewhich.c +++ b/Build/source/texk/kpathsea/kpsewhich.c @@ -1,7 +1,7 @@ /* kpsewhich -- standalone path lookup and variable expansion for Kpathsea. Ideas from Thomas Esser, Pierre MacKay, and many others. - Copyright 1995-2010 Karl Berry & Olaf Weber. + Copyright 1995-2011 Karl Berry & Olaf Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -272,15 +272,27 @@ subdir_match (str_list_type subdirs, string *matches) { string *ret = XTALLOC1 (string); unsigned len = 1; + unsigned e; unsigned m; +#if defined(WIN32) + string p; + + for (e = 0; e < STR_LIST_LENGTH (subdirs); e++) { + for (p = STR_LIST_ELT (subdirs, e); *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + } +#endif for (m = 0; matches[m]; m++) { unsigned loc; - unsigned e; string s = xstrdup (matches[m]); - for (loc = strlen (s); loc > 0 && !IS_DIR_SEP (s[loc-1]); loc--) + for (loc = strlen (s); loc > 0 && !IS_DIR_SEP_CH (s[loc-1]); loc--) ; - while (loc > 0 && IS_DIR_SEP (s[loc-1])) { + while (loc > 0 && IS_DIR_SEP_CH (s[loc-1])) { loc--; } s[loc] = 0; /* wipe out basename */ @@ -288,7 +300,7 @@ subdir_match (str_list_type subdirs, string *matches) for (e = 0; e < STR_LIST_LENGTH (subdirs); e++) { string subdir = STR_LIST_ELT (subdirs, e); unsigned subdir_len = strlen (subdir); - while (subdir_len > 0 && IS_DIR_SEP (subdir[subdir_len-1])) { + while (subdir_len > 0 && IS_DIR_SEP_CH (subdir[subdir_len-1])) { subdir_len--; subdir[subdir_len] = 0; /* remove trailing slashes from subdir spec */ } |