diff --git a/source/extract.cpp b/source/extract.cpp index eab3b76..58e2fa7 100644 --- a/source/extract.cpp +++ b/source/extract.cpp @@ -114,7 +114,7 @@ namespace extract { } if (appPath != filename) { if ((overwriteInis == 0 && filename.substr(filename.length() - 4) == ".ini") || std::find_if(ignoreList.begin(), ignoreList.end(), [&filename](std::string ignored) { - u8 res = (filename).find(ignored); + u8 res = filename.find(ignored); return (res == 0 || res == 1); }) != ignoreList.end()) { if (!std::filesystem::exists(filename)) { extractEntry(filename, zfile); diff --git a/source/fs.cpp b/source/fs.cpp index 07a91b3..0f7d61b 100644 --- a/source/fs.cpp +++ b/source/fs.cpp @@ -106,16 +106,19 @@ namespace fs { std::set readLineByLine(const std::string& path) { - std::set titles; - std::string str; - std::ifstream in(path); - if (in) { - while (std::getline(in, str)) { - if (str.size() > 0) - titles.insert(str); + std::set res; + std::ifstream lines(path); + std::string line; + if (lines) { + while (std::getline(lines, line)) { + if (line.size() > 0) { + if (line.back() == '\r') + line.pop_back(); + res.insert(line); + } } } - return titles; + return res; } Result getFreeStorageSD(s64& free)