From 5514a0f285376a747dc22fa9556b2c9ebaefccf6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 14 Jul 2006 22:37:38 +0000 Subject: (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 --- Build/source/texk/kpathsea/expand.c | 10 ++++++++-- 1 file 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 -- cgit v1.2.3