update_ext.cpp: Fix wildcard handling for delete list

Origin commit data
------------------
Commit: de36ce60c4
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-02-10 (Sun, 10 Feb 2013)
This commit is contained in:
Michael Liebmann
2013-02-10 10:17:42 +01:00
parent 30a218c9ca
commit b6eb1f2f6b

View File

@@ -596,13 +596,13 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
// read DeleteList // read DeleteList
for(it = deleteList.begin(); it != deleteList.end(); ++it) { for(it = deleteList.begin(); it != deleteList.end(); ++it) {
line = *it; line = *it;
if (lstat(line.c_str(), &FileInfo) != -1) { if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) {
if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { // Wildcards
// Wildcards WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str());
WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); deleteFileList(line.c_str());
deleteFileList(line.c_str()); }
} else if (lstat(line.c_str(), &FileInfo) != -1) {
else if (S_ISREG(FileInfo.st_mode)) { if (S_ISREG(FileInfo.st_mode)) {
// File // File
WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); WRITE_UPDATE_LOG("delete file: %s\n", line.c_str());
unlink(line.c_str()); unlink(line.c_str());