diff options
author | randomdan <randomdan@localhost> | 2011-01-25 20:59:48 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-01-25 20:59:48 +0000 |
commit | 7e1ed147e60b28551f96478dfa90faffac7117b2 (patch) | |
tree | 3dc7f7d36f4bab486e708f055e034ed493ca1aad | |
parent | Fix #if check for UUID implementation (diff) | |
download | project2-7e1ed147e60b28551f96478dfa90faffac7117b2.tar.bz2 project2-7e1ed147e60b28551f96478dfa90faffac7117b2.tar.xz project2-7e1ed147e60b28551f96478dfa90faffac7117b2.zip |
Only trim newline from lines that end with newline
-rw-r--r-- | project2/fileRows.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/project2/fileRows.cpp b/project2/fileRows.cpp index 7251a9f..600ab7c 100644 --- a/project2/fileRows.cpp +++ b/project2/fileRows.cpp @@ -2,6 +2,7 @@ #include "rowProcessor.h" #include "xmlObjectLoader.h" #include "exceptions.h" +#include <boost/algorithm/string/predicate.hpp> ElementLoaderImpl<FileRows> filerowsLoader("filerows"); @@ -59,7 +60,9 @@ FileRows::execute(const RowProcessor * rp) const c.set_line_term(newline); Glib::ustring line; while (c.read_line(line) == Glib::IO_STATUS_NORMAL) { - line.erase(line.length() - newline.length()); + if (boost::algorithm::ends_with(line, newline)) { + line.erase(line.length() - newline.length()); + } Columns::const_iterator curCol = columns.begin(); bool mkCols = columns.empty(); bool inQuotes = false; |