From 53a86b8a39f6783364566b93ad815a776b89eb84 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 22 Apr 2017 04:55:40 +0000 Subject: update win32lib.c and mingw32.c (w32 only) git-svn-id: svn://tug.org/texlive/trunk@43971 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 ++++ Build/source/texk/kpathsea/mingw32.c | 28 ++++++++++++++++++---------- Build/source/texk/kpathsea/win32lib.c | 28 ++++++++++++++++++---------- 3 files changed, 40 insertions(+), 20 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index a7ab61e1910..a9fe65a3808 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2017-04-22 Akira Kakuto + + * win32lib.c, mingw32.c: Update texlive_gs_init() (w32 only). + 2017-04-21 Akira Kakuto * win32lib.c, mingw32.c: Update texlive_gs_init() (w32 only). diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c index 10d21e492a5..2eaf763aa31 100644 --- a/Build/source/texk/kpathsea/mingw32.c +++ b/Build/source/texk/kpathsea/mingw32.c @@ -409,26 +409,34 @@ void texlive_gs_init(void) { char *nptr, *path; char tlgsbindir[512]; - char tlgslibdir[1024]; + char tlgslibdir[512]; + char resourcedir[512]; nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); - if (nptr == NULL || !strcmp(nptr, "0") || !strcmp(nptr, "n") || !strcmp(nptr, "f")) { + 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"); + strcpy(resourcedir, tlgsbindir); + strcat(resourcedir, "/Resource"); if(is_dir(tlgsbindir)) { strcpy(tlgslibdir, tlgsbindir); strcat(tlgslibdir, "/lib;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/fonts;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/Resource/Init;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/Resource;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/kanji"); + if(is_dir(resourcedir)) { + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/Resource/Init;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/Resource;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/kanji"); + } else { + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + } strcat(tlgsbindir, "/bin;"); free(nptr); for(nptr = tlgsbindir; *nptr; nptr++) { diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index 9e7bba6707d..35d57463650 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -133,26 +133,34 @@ void texlive_gs_init(void) { char *nptr, *path; char tlgsbindir[512]; - char tlgslibdir[1024]; + char tlgslibdir[512]; + char resourcedir[512]; nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); - if (nptr == NULL || !strcmp(nptr, "0") || !strcmp(nptr, "n") || !strcmp(nptr, "f")) { + 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"); + strcpy(resourcedir, tlgsbindir); + strcat(resourcedir, "/Resource"); if(is_dir(tlgsbindir)) { strcpy(tlgslibdir, tlgsbindir); strcat(tlgslibdir, "/lib;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/fonts;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/Resource/Init;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/Resource;"); - strcat(tlgslibdir, tlgsbindir); - strcat(tlgslibdir, "/kanji"); + if(is_dir(resourcedir)) { + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/Resource/Init;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/Resource;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/kanji"); + } else { + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + } strcat(tlgsbindir, "/bin;"); free(nptr); for(nptr = tlgsbindir; *nptr; nptr++) { -- cgit v1.2.3