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 | |
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')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/db.c | 33 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/kpsewhich.c | 22 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.c | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.h | 1 |
5 files changed, 44 insertions, 27 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 5bfdf89feb8..ae71c4f4599 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,14 @@ +2011-08-03 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mingw32.[ch] (dostounix_filename): Remove unused function. + +2011-08-03 Peter Breitenlohner <peb@mppmu.mpg.de> + + More diffs between TeX Live and W32TeX. + * db.c (ignore_dir_p, db_build, match), + kpsewhich.c (subdir_match): Slashify and test for 2-Byte Kanji + (CP 932, SJIS) codes. + 2011-08-03 Akirar Kakuto <kakuto@fuk.kindai.ac.jp> * win32lib.h: #include <direct.h> for _getcwd. diff --git a/Build/source/texk/kpathsea/db.c b/Build/source/texk/kpathsea/db.c index d4cf9c6e2e2..36dd87f6f0c 100644 --- a/Build/source/texk/kpathsea/db.c +++ b/Build/source/texk/kpathsea/db.c @@ -69,17 +69,9 @@ ignore_dir_p (const_string dirname) { const_string dot_pos = dirname; -#if defined(WIN32) - while (*(++dot_pos)) { - if (IS_KANJI(dot_pos-1)) - dot_pos++; - else if (*dot_pos == '.' && -#else while ((dot_pos = strchr (dot_pos + 1, '.'))) { - if ( -#endif /* If / before and no / after, skip it. */ - IS_DIR_SEP (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP (dot_pos[1])) + if (IS_DIR_SEP_CH (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP_CH (dot_pos[1])) return true; } @@ -111,11 +103,12 @@ db_build (kpathsea kpse, hash_table_type *table, const_string db_filename) #if defined(WIN32) for (pp = line; *pp; pp++) { - if (IS_KANJI(pp)) { + if (*pp == '\\') + *pp = '/'; + else if (IS_KANJI(pp)) pp++; - continue; - } - *pp = TRANSFORM(*pp); + else + *pp = TRANSFORM(*pp); } #endif @@ -231,9 +224,9 @@ match (const_string filename, const_string path_elt) if (FILECHARCASEEQ (*filename, *path_elt)) /* normal character match */ ; - else if (IS_DIR_SEP (*path_elt) /* at // */ - && original_filename < filename && IS_DIR_SEP (path_elt[-1])) { - while (IS_DIR_SEP (*path_elt)) + else if (IS_DIR_SEP_CH (*path_elt) /* at // */ + && original_filename < filename && IS_DIR_SEP_CH (path_elt[-1])) { + while (IS_DIR_SEP_CH (*path_elt)) path_elt++; /* get past second and any subsequent /'s */ if (*path_elt == 0) { /* Trailing //, matches anything. We could make this part of the @@ -244,7 +237,7 @@ match (const_string filename, const_string path_elt) /* Intermediate //, have to match rest of PATH_ELT. */ for (; !matched && *filename; filename++) { /* Try matching at each possible character. */ - if (IS_DIR_SEP (filename[-1]) + if (IS_DIR_SEP_CH (filename[-1]) && FILECHARCASEEQ (*filename, *path_elt)) matched = match (filename, path_elt); } @@ -266,7 +259,7 @@ match (const_string filename, const_string path_elt) hand, if PATH_ELT ended with a / (as in `vf/'), FILENAME being the same `vf/ptmr.vf', we'll be at the `p'. Upshot: if we're at a dir sep in FILENAME, skip it. */ - if (IS_DIR_SEP (*filename)) + if (IS_DIR_SEP_CH (*filename)) filename++; /* Here are the basic possibilities for the check on being at the @@ -284,8 +277,8 @@ match (const_string filename, const_string path_elt) a FILENAME without dir seps. (This could be argued, and may never happen in practice, but is the historical behavior.) */ /* if original_filename != filename then original_filename < filename */ - if (original_filename == filename || IS_DIR_SEP (filename[-1])) { - while (*filename && !IS_DIR_SEP (*filename)) + if (original_filename == filename || IS_DIR_SEP_CH (filename[-1])) { + while (*filename && !IS_DIR_SEP_CH (*filename)) filename++; matched = *filename == 0; } 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 */ } diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c index 9da8d774074..f6912365422 100644 --- a/Build/source/texk/kpathsea/mingw32.c +++ b/Build/source/texk/kpathsea/mingw32.c @@ -206,11 +206,13 @@ normalize_filename (char *fp, char path_sep) /* Destructively turn backslashes into slashes. */ -void +#if 0 /* unused */ +static void dostounix_filename (char *p) { normalize_filename (p, '/'); } +#endif /* Destructively turn slashes into backslashes. */ static void diff --git a/Build/source/texk/kpathsea/mingw32.h b/Build/source/texk/kpathsea/mingw32.h index db6a53e37bc..d7e28cda207 100644 --- a/Build/source/texk/kpathsea/mingw32.h +++ b/Build/source/texk/kpathsea/mingw32.h @@ -41,6 +41,5 @@ extern char *quote_args(char **); #endif /* MAKE_KPSE_DLL */ extern KPSEDLL BOOL win32_get_long_filename (char *, char *, int); -extern KPSEDLL void dostounix_filename (char *p); #endif |