summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dviljk/ChangeLog4
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index c6a8a9c74cf..a70c472f153 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-03 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dvi2xx.c [WIN32]: Avoid segmentation fault for missing WINDIR.
+
2012-10-02 Peter Breitenlohner <peb@mppmu.mpg.de>
* dvi2xx.c [WIN32]: Drop is_dir() and handle tmp_dir differently
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index b58e85ab0a7..fcc11370791 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -4021,16 +4021,19 @@ void DoSpecial(char *str, int n)
if ( tmp_dir[0] == '\0' ) {
const char * base_dir, * base_base;
#ifdef WIN32
- char *def_tmp = concat (getenv ("WINDIR"), "/Temp");
+ char *def_tmp;
+ if ( (base_dir = getenv("WINDIR")) == NULL )
+ base_dir = "";
+ def_tmp = concat (base_dir, "/Temp");
if ( (base_dir = getenv("TMPDIR")) == NULL &&
(base_dir = getenv("TMP")) == NULL &&
- (base_dir = getenv("TEMP")) == NULL ) {
+ (base_dir = getenv("TEMP")) == NULL )
#else
# define def_tmp "/tmp"
- if ( (base_dir = getenv("TMPDIR")) == NULL ) {
+ if ( (base_dir = getenv("TMPDIR")) == NULL )
#endif
base_dir = def_tmp;
- } else if ( strlen(base_dir) > STRSIZE - sizeof("/dviljkXXXXXX/include.pcl") ) {
+ else if ( strlen(base_dir) > STRSIZE - sizeof("/dviljkXXXXXX/include.pcl") ) {
Warning ("TMPDIR %s is too long, using %s instead", base_dir, def_tmp);
base_dir = def_tmp;
}