--- 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