summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-01-25 20:59:48 +0000
committerrandomdan <randomdan@localhost>2011-01-25 20:59:48 +0000
commit7e1ed147e60b28551f96478dfa90faffac7117b2 (patch)
tree3dc7f7d36f4bab486e708f055e034ed493ca1aad
parentFix #if check for UUID implementation (diff)
downloadproject2-7e1ed147e60b28551f96478dfa90faffac7117b2.tar.bz2
project2-7e1ed147e60b28551f96478dfa90faffac7117b2.tar.xz
project2-7e1ed147e60b28551f96478dfa90faffac7117b2.zip
Only trim newline from lines that end with newline
-rw-r--r--project2/fileRows.cpp5
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;