Level-Konverter: Leerzeichen am Ende von Optionszeilen trimmen.
authorWintermate <wintermute@hannover.ccc.de>
Tue, 22 Oct 2013 12:32:48 +0000 (14:32 +0200)
committerWintermate <wintermute@hannover.ccc.de>
Tue, 22 Oct 2013 12:32:48 +0000 (14:32 +0200)
mock/tools/level-converter.cc

index eccd3e0..88e9315 100644 (file)
@@ -6,6 +6,7 @@ extern "C" {
 }
 
 #include <boost/spirit/include/qi_symbols.hpp>
+#include <boost/algorithm/string/trim.hpp>
 
 #include <algorithm>
 #include <fstream>
@@ -77,7 +78,7 @@ namespace jnrcpp {
 
       std::string name;
       while(std::getline(in, name)) {
-        if(name != "") {
+        if(boost::trim_copy(name) != "") {
           names.push_back(name);
         }
       }
@@ -119,7 +120,7 @@ namespace jnrcpp {
           } else {
             throw std::invalid_argument("Unkown type: " + line);
           }
-        } else if(line != "") {
+        } else if(boost::trim_right_copy(line) != "") {
           char c;
           std::string tok;
           std::istringstream parser(line);
This page took 0.035426 seconds and 4 git commands to generate.