[partition] Actually remove invalid fstab entries

This commit is contained in:
Adriaan de Groot 2024-04-28 15:22:35 +02:00
parent 35990d9a6b
commit 93094948fa

View File

@ -262,8 +262,9 @@ lookForFstabEntries( const QString& partitionPath )
} }
fstabFile.close(); fstabFile.close();
const int lineCount = fstabEntries.count(); const int lineCount = fstabEntries.count();
std::remove_if( const auto invalidEntries = std::remove_if(
fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } ); fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } );
fstabEntries.erase(invalidEntries);
cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries from" << lineCount cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries from" << lineCount
<< "lines in" << fstabFile.fileName(); << "lines in" << fstabFile.fileName();
} }