Commit d5c132fc authored by Max Kellermann's avatar Max Kellermann

db/update/ExcludeList: move code to ParseLine()

parent 5f082a27
......@@ -35,6 +35,18 @@
#include <assert.h>
#include <string.h>
inline void
ExcludeList::ParseLine(char *line) noexcept
{
char *p = strchr(line, '#');
if (p != nullptr)
*p = 0;
p = Strip(line);
if (*p != 0)
patterns.emplace_front(p);
}
bool
ExcludeList::LoadFile(Path path_fs) noexcept
try {
......@@ -42,15 +54,8 @@ try {
TextFile file(path_fs);
char *line;
while ((line = file.ReadLine()) != nullptr) {
char *p = strchr(line, '#');
if (p != nullptr)
*p = 0;
p = Strip(line);
if (*p != 0)
patterns.emplace_front(p);
}
while ((line = file.ReadLine()) != nullptr)
ParseLine(line);
#else
/* not implemented */
(void)path_fs;
......
......@@ -69,6 +69,9 @@ public:
* the specified file name.
*/
bool Check(Path name_fs) const noexcept;
private:
void ParseLine(char *line) noexcept;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment