From 37a2f2bc90ccbb5296aece444db121e0928b1acd Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 15 Mar 2018 13:54:53 +0100 Subject: [PATCH] fixed faulty article skipping (bug introduced in 0.4.0) --- CMakeLists.txt | 2 +- src/parse.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a13762..51cdadd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.4.0 + VERSION 0.4.1 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index 298456d..099b8ef 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -122,6 +122,7 @@ std::vector parse_website(const string &xml) string desc = v.second.get_child("description").data(); string str = title + "\n\n" + desc; + bool skipthis = false; try { // Skip entries beginning with this text @@ -132,7 +133,8 @@ std::vector parse_website(const string &xml) { if (title.compare(0, skip.length(), skip) == 0) { - continue; + skipthis = true; + break; } } } @@ -141,6 +143,10 @@ std::vector parse_website(const string &xml) { // Node not found, no problem } + if (skipthis) + { + continue; + } unescape_html(str);