 texk/xdvik/xdvi.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

Index: tetex-bin-3.0/texk/xdvik/xdvi.c
===================================================================
--- tetex-bin-3.0.orig/texk/xdvik/xdvi.c	2006-03-02 14:46:40.000000000 +0100
+++ tetex-bin-3.0/texk/xdvik/xdvi.c	2006-03-02 16:10:18.000000000 +0100
@@ -3964,8 +3964,13 @@
 	
     if (real_filename == NULL)
 	return NULL;
-    
-    ret = REALPATH(real_filename, canonical_path);
+
+    if ((ret = REALPATH(real_filename, canonical_path)) == NULL) {
+	/* REALPATH failed, use real_filename */
+	strncpy(canonical_path, real_filename, MAXPATHLEN);
+	canonical_path[MAXPATHLEN] = '\0';
+	ret = canonical_path;
+    }
     free(real_filename);
 
     /* check for correct DVI files */
