From 5b01add8dff1f92b33a319edc9efc51f54abfa2b Mon Sep 17 00:00:00 2001 From: randomdan Date: Tue, 25 Jan 2011 20:59:48 +0000 Subject: Only trim newline from lines that end with newline --- project2/fileRows.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ElementLoaderImpl 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; -- cgit v1.2.3