Fixed load .gset file error (#293)
This commit is contained in:
parent
0004bf4a23
commit
bda59b7c62
@ -55,10 +55,11 @@ void scanDirectoryAppend(const string& path, const string& ext, vector<string>&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int extLen = strlen(ext.c_str());
|
||||||
while ((current = readdir(dp)) != 0)
|
while ((current = readdir(dp)) != 0)
|
||||||
{
|
{
|
||||||
int len = strlen(current->d_name);
|
int len = strlen(current->d_name);
|
||||||
if (len > 4 && strncmp(current->d_name + len - 4, ext.c_str(), 4) == 0)
|
if (len > extLen && strncmp(current->d_name + len - extLen, ext.c_str(), extLen) == 0)
|
||||||
{
|
{
|
||||||
filelist.push_back(current->d_name);
|
filelist.push_back(current->d_name);
|
||||||
}
|
}
|
||||||
@ -74,4 +75,4 @@ void scanDirectory(const string& path, const string& ext, vector<string>& fileli
|
|||||||
{
|
{
|
||||||
filelist.clear();
|
filelist.clear();
|
||||||
scanDirectoryAppend(path, ext, filelist);
|
scanDirectoryAppend(path, ext, filelist);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user