summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/mingw32.c28
-rw-r--r--Build/source/texk/kpathsea/win32lib.c28
3 files changed, 40 insertions, 20 deletions
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 <kakuto@fuk.kindai.ac.jp>
+
+ * win32lib.c, mingw32.c: Update texlive_gs_init() (w32 only).
+
2017-04-21 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* 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++) {