Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 53955843e81b1f369ad60b94ae20b253 > files > 3

xedit-1.0.2-7mdv2008.0.src.rpm

--- xedit-1.0.2.orig/util.c	2005-10-20 16:24:27.000000000 -0200
+++ xedit-1.0.2/util.c	2007-09-05 14:03:12.000000000 -0300
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>		/* for realpath() */
+#include <errno.h>
 #include "xedit.h"
 
 #include <X11/Xfuncs.h>
@@ -461,11 +462,24 @@
 char *
 ResolveName(char *filename)
 {
+#ifndef __UNIXOS2__
+    char *result;
+#endif
+
     if (filename == NULL)
 	filename = GetString(filenamewindow);
 
 #ifndef __UNIXOS2__
-    return (realpath(filename, name));
+    result = realpath(filename, name);
+
+    if (result == NULL && errno == ENOENT) {
+	char *dir = dirname(filename);
+
+	if (dir && access(dir, F_OK) == 0)
+	    result = name;
+    }
+
+    return (result);
 #else
     return filename;
 #endif