From 368c76584a33996d358ac5341b92dc7135cad490 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Mon, 12 Aug 2013 08:43:31 +0000 Subject: Do nothing in texlive_gs_init() if TEXLIVE_WINDOWS_EXTERNAL_GS is defined and its value is not '0', 'n', or 'f'. git-svn-id: svn://tug.org/texlive/trunk@31419 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 6 +++++ Build/source/texk/kpathsea/mingw32.c | 45 ++++++++++++++++++++--------------- Build/source/texk/kpathsea/win32lib.c | 45 ++++++++++++++++++++--------------- 3 files changed, 58 insertions(+), 38 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 4937bbdb3e7..85d11ad90d4 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,9 @@ +2013-08-12 Akira Kakuto + + * win32lib.c, mingw32.c (texlive_gs_init()): Do nothing if + TEXLIVE_WINDOWS_EXTERNAL_GS is defined and its value is not + '0', 'n', or 'f'. + 2013-08-07 Karl Berry * line.c (read_line): only at EOF if loc==0, i.e., do not ignore a diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c index 6e8b38e899d..c5d2c6e71ab 100644 --- a/Build/source/texk/kpathsea/mingw32.c +++ b/Build/source/texk/kpathsea/mingw32.c @@ -404,27 +404,34 @@ void texlive_gs_init(void) char *nptr, *path; char tlgsbindir[512]; char tlgslibdir[512]; - nptr = kpse_var_value("SELFAUTOPARENT"); - if (nptr) { - strcpy(tlgsbindir, nptr); - strcat(tlgsbindir,"/tlpkg/tlgs"); - if(is_dir(tlgsbindir)) { - strcpy(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/lib;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/fonts"); - strcat(tlgsbindir, "/bin;"); - free(nptr); - for(nptr = tlgsbindir; *nptr; nptr++) { - if(*nptr == '/') *nptr = '\\'; + nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); + if (nptr == NULL || *nptr == '0' || *nptr == 'n' || *nptr == 'f') { + if (nptr) + free (nptr); + nptr = kpse_var_value("SELFAUTOPARENT"); + if (nptr) { + strcpy(tlgsbindir, nptr); + strcat(tlgsbindir,"/tlpkg/tlgs"); + if(is_dir(tlgsbindir)) { + strcpy(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/lib;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + strcat(tlgsbindir, "/bin;"); + free(nptr); + for(nptr = tlgsbindir; *nptr; nptr++) { + if(*nptr == '/') *nptr = '\\'; + } + nptr = getenv("PATH"); + path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); + strcpy(path, tlgsbindir); + strcat(path, nptr); + xputenv("PATH", path); + xputenv("GS_LIB", tlgslibdir); } - nptr = getenv("PATH"); - path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); - strcpy(path, tlgsbindir); - strcat(path, nptr); - xputenv("PATH", path); - xputenv("GS_LIB", tlgslibdir); } + } else { + free (nptr); } } diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index 0f1d353b745..d80967ef2ff 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -102,27 +102,34 @@ void texlive_gs_init(void) char *nptr, *path; char tlgsbindir[512]; char tlgslibdir[512]; - nptr = kpse_var_value("SELFAUTOPARENT"); - if (nptr) { - strcpy(tlgsbindir, nptr); - strcat(tlgsbindir,"/tlpkg/tlgs"); - if(is_dir(tlgsbindir)) { - strcpy(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/lib;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/fonts"); - strcat(tlgsbindir, "/bin;"); - free(nptr); - for(nptr = tlgsbindir; *nptr; nptr++) { - if(*nptr == '/') *nptr = '\\'; + nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); + if (nptr == NULL || *nptr == '0' || *nptr == 'n' || *nptr == 'f') { + if (nptr) + free (nptr); + nptr = kpse_var_value("SELFAUTOPARENT"); + if (nptr) { + strcpy(tlgsbindir, nptr); + strcat(tlgsbindir,"/tlpkg/tlgs"); + if(is_dir(tlgsbindir)) { + strcpy(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/lib;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + strcat(tlgsbindir, "/bin;"); + free(nptr); + for(nptr = tlgsbindir; *nptr; nptr++) { + if(*nptr == '/') *nptr = '\\'; + } + nptr = getenv("PATH"); + path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); + strcpy(path, tlgsbindir); + strcat(path, nptr); + xputenv("PATH", path); + xputenv("GS_LIB", tlgslibdir); } - nptr = getenv("PATH"); - path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); - strcpy(path, tlgsbindir); - strcat(path, nptr); - xputenv("PATH", path); - xputenv("GS_LIB", tlgslibdir); } + } else { + free (nptr); } } -- cgit v1.2.3