diff options
Diffstat (limited to 'Build/source/texk/kpathsea/win32lib.c')
-rw-r--r-- | Build/source/texk/kpathsea/win32lib.c | 28 |
1 files changed, 18 insertions, 10 deletions
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++) { |