diff --git a/filename_absolute.cxx b/e:/temp/src/filename_absolute.cxx index e39da32..85ba968 100644 --- a/filename_absolute.cxx +++ b/e:/temp/src/filename_absolute.cxx @@ -27,7 +27,7 @@ #include #include "flstring.h" -inline int isdirsep(char c) {return c == '/';} +static inline int isdirsep(char c) {return c == '/';} // Issue #141: declare static so driver uses own copy /** Makes a filename absolute from a relative filename. \code @@ -72,7 +72,7 @@ int Fl_System_Driver::filename_absolute(char *to, int tolen, const char *from) { if (isdirsep(*(a-1))) a--; /* remove intermediate . and .. names: */ while (*start == '.') { - if (start[1]=='.' && isdirsep(start[2])) { + if (start[1] == '.' && (isdirsep(start[2]) || !start[2])) { // Issue #142: handle lone ".." char *b; for (b = a-1; b >= temp && !isdirsep(*b); b--) {/*empty*/} if (b < temp) break;