mirror of
https://github.com/znc/znc.git
synced 2026-05-02 19:42:32 +02:00
Make CFile::IsDir() work on those weird OS that don't like trailing slashes
Yeah, I'm talking windows here. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1355 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -57,8 +57,13 @@ void CFile::SetFileName(const CString& sLongName) {
|
||||
}
|
||||
}
|
||||
|
||||
bool CFile::IsDir(const CString& sLongName, bool bUseLstat) {
|
||||
// Some OS don't like trailing slashes for directories
|
||||
return CFile::FType(sLongName.Trim_Right_n("/"),
|
||||
FT_DIRECTORY, bUseLstat);
|
||||
}
|
||||
|
||||
bool CFile::IsReg(const CString& sLongName, bool bUseLstat) { return CFile::FType(sLongName, FT_REGULAR, bUseLstat); }
|
||||
bool CFile::IsDir(const CString& sLongName, bool bUseLstat) { return CFile::FType(sLongName, FT_DIRECTORY, bUseLstat); }
|
||||
bool CFile::IsChr(const CString& sLongName, bool bUseLstat) { return CFile::FType(sLongName, FT_CHARACTER, bUseLstat); }
|
||||
bool CFile::IsBlk(const CString& sLongName, bool bUseLstat) { return CFile::FType(sLongName, FT_BLOCK, bUseLstat); }
|
||||
bool CFile::IsFifo(const CString& sLongName, bool bUseLstat) { return CFile::FType(sLongName, FT_FIFO, bUseLstat); }
|
||||
|
||||
Reference in New Issue
Block a user