diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-08-12 08:43:31 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-08-12 08:43:31 +0000 |
commit | 368c76584a33996d358ac5341b92dc7135cad490 (patch) | |
tree | 5194a19fdf849375bc49b78e155be2f57ecf3d38 /Build/source/texk/kpathsea | |
parent | a0a005f7e43b315990811d3e21330d2487ede1cd (diff) |
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
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.c | 45 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/win32lib.c | 45 |
3 files changed, 58 insertions, 38 deletions
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 <kakuto@fuk.kindai.ac.jp> + + * 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 <karl@tug.org> * 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); } } |