diff --git a/src/Article.cxx b/src/Article.cxx index 6b59367..b48fccf 100644 --- a/src/Article.cxx +++ b/src/Article.cxx @@ -54,17 +54,13 @@ namespace Article { ignore_line = false; std::list cfg_lines = { "" }; - while (fgets(buf, buflen, a) != NULL) { // Ignore blank lines or lines starting with a comment. if (buf[0] == '#') { - ignore_line = true; + if (strlen(buf) < buflen) continue; + else ignore_line = true; continue; - } else if (buf[0] == '\n') { - if (ignore_line) - ignore_line = false; - continue; - } + } int eol = -1; for (int c = 0; c < buflen; c++) { // Check if this loop has already done what it's supposed to do by checking if the title has been set. @@ -119,6 +115,7 @@ namespace Article { bool reading_article_metadata = false; for (std::string const &line : cfg_lines) { + if (line == "") continue; std::cout << "[!] " << line << "\n"; // Check namespace if (reading_article_metadata) {