1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-02 01:11:54 +02:00

Ignore OPK files of which the name starts with a dot

These are not actual OPK files, but metadata (I assume) storage that
Mac OS X adds to vfat file systems. The current version of libopk has
extremely poor error handling, so ignoring these files avoids a crash.
But even when libopk is fixed, not trying to open these files as OPKs
will be useful since it saves time.
This commit is contained in:
Maarten ter Huurne 2013-01-24 23:26:30 +01:00
parent e4d78bee60
commit 90ec4b9ace

View File

@ -464,6 +464,12 @@ void Menu::readPackages(std::string parentDir)
if (strcasecmp(c + 1, "opk")) if (strcasecmp(c + 1, "opk"))
continue; continue;
if (dptr->d_name[0] == '.') {
// Ignore hidden files.
// Mac OS X places these on SD cards, probably to store metadata.
continue;
}
path = parentDir + '/' + dptr->d_name; path = parentDir + '/' + dptr->d_name;
pdata = opk_open(path.c_str()); pdata = opk_open(path.c_str());