diff --git a/stepmania/PBProject/Installer/Util.cpp b/stepmania/PBProject/Installer/Util.cpp index 39b2563099..1cee7bb293 100644 --- a/stepmania/PBProject/Installer/Util.cpp +++ b/stepmania/PBProject/Installer/Util.cpp @@ -20,7 +20,8 @@ void split(const CString& Source, const CString& Deliminator, vector& A { unsigned startpos = 0; - do { + do + { unsigned pos = Source.find(Deliminator, startpos); if (pos == Source.npos) pos=Source.size(); @@ -28,15 +29,17 @@ void split(const CString& Source, const CString& Deliminator, vector& A AddIt.push_back(AddCString); startpos=pos+Deliminator.size(); - } while (startpos <= Source.size()); + } + while (startpos <= Source.size()); } bool IsADirectory(const CString& path) { struct stat s; - if (stat(path, &s)) + if (lstat(path, &s)) return false; - return (s.st_mode & S_IFDIR) && !(s.st_mode & S_IFLNK); + return ((s.st_mode & S_IFDIR) == S_IFDIR) && + ((s.st_mode & S_IFLNK) != S_IFLNK); } bool DoesFileExist(const CString& path)