From 90ec4b9aceebff0df800631a821cea639b76abb7 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Thu, 24 Jan 2013 23:26:30 +0100 Subject: [PATCH] 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. --- src/menu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/menu.cpp b/src/menu.cpp index 4737b2e..4fba8f0 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -464,6 +464,12 @@ void Menu::readPackages(std::string parentDir) if (strcasecmp(c + 1, "opk")) 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; pdata = opk_open(path.c_str());