diff --git a/goldlib/gall/gdirposx.cpp b/goldlib/gall/gdirposx.cpp index 46a6897..a8a8c09 100644 --- a/goldlib/gall/gdirposx.cpp +++ b/goldlib/gall/gdirposx.cpp @@ -121,9 +121,10 @@ void gposixdir::cd(const char *name, bool relative) ok = maketruepath(dirname); entries.clear(); ndirname = dirname; - if (ndirname[ndirname.size()-1] != '/') - ndirname += "/"; - ndirname += "*"; + if ((ndirname.end() > ndirname.begin()) && (*(ndirname.end()-1) == '/')) + ndirname += "*"; + else + ndirname += "/*"; struct _finddata_t de; long d = _findfirst(ndirname.c_str(), &de); if(d == -1) {