diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-14 22:37:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-14 22:37:38 +0000 |
commit | 5514a0f285376a747dc22fa9556b2c9ebaefccf6 (patch) | |
tree | 8bc4f0c11370e57ce6af02a5d90363a3b80be035 | |
parent | fabee7b65b47d17baab772d0b494e1ce6f30e7c5 (diff) |
(kpse_expand_kpse_dot): omit empty path elements
from TEXMFCNF, per http://bugs.debian.org/358330.
Patch from Julian Gilbey, tex-k/tex-live mail
27 Mar 2006 19:32:43 +0100.
git-svn-id: svn://tug.org/texlive/trunk@1839 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/expand.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Build/source/texk/kpathsea/expand.c b/Build/source/texk/kpathsea/expand.c index 78ea662f566..6cac289fb89 100644 --- a/Build/source/texk/kpathsea/expand.c +++ b/Build/source/texk/kpathsea/expand.c @@ -84,6 +84,7 @@ kpse_expand_kpse_dot P1C(string, path) for (elt = kpse_path_element (path); elt; elt = kpse_path_element (NULL)) { string save_ret = ret; + boolean ret_copied = true; /* We assume that the !! magic is only used on absolute components. Single "." gets special treatment, as does "./" or its equivalent. */ if (kpse_absolute_p (elt, false) || (elt[0] == '!' && elt[1] == '!')) { @@ -93,11 +94,16 @@ kpse_expand_kpse_dot P1C(string, path) #ifndef VMS } else if (elt[0] == '.' && IS_DIR_SEP(elt[1])) { ret = concatn (ret, kpse_dot, elt + 1, ENV_SEP_STRING, NULL); - } else { + } else if (*elt) { ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL); #endif + } else { + /* omit empty path elements from TEXMFCNF. + See http://bugs.debian.org/358330. */ + ret_copied = false; } - free (save_ret); + if (ret_copied) + free (save_ret); } #ifdef MSDOS |