diff options
-rw-r--r-- | beos/gui.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp index 19046a5e4..9ecfbd0ff 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -309,12 +309,18 @@ static char *find_resource(char *buf, const char *filename, const char *def) if (def[0] == '%') { snprintf(t, PATH_MAX, "%s%s", path.Path(), def + 1); - realpath(t, buf); + if (realpath(t, buf) == NULL) { + strcpy(buf, t); + } } else if (def[0] == '~') { snprintf(t, PATH_MAX, "%s%s", getenv("HOME"), def + 1); - realpath(t, buf); + if (realpath(t, buf) == NULL) { + strcpy(buf, t); + } } else { - realpath(def, buf); + if (realpath(def, buf) == NULL) { + strcpy(buf, def); + } } return buf; |