diff --git a/include/CLI/StringTools.hpp b/include/CLI/StringTools.hpp index f1aa04b5..25320160 100644 --- a/include/CLI/StringTools.hpp +++ b/include/CLI/StringTools.hpp @@ -167,7 +167,7 @@ std::vector inline split_up(std::string str) { output.push_back(str.substr(1,end-1)); str = str.substr(end+1); } else { - output.push_back(str); + output.push_back(str.substr(1)); str = ""; } } else if(str[0] == '\"') { @@ -176,7 +176,7 @@ std::vector inline split_up(std::string str) { output.push_back(str.substr(1,end-1)); str = str.substr(end+1); } else { - output.push_back(str); + output.push_back(str.substr(1)); str = ""; } diff --git a/tests/HelpersTest.cpp b/tests/HelpersTest.cpp index 6c067f3f..b9ae91cd 100644 --- a/tests/HelpersTest.cpp +++ b/tests/HelpersTest.cpp @@ -298,12 +298,12 @@ TEST(SplitUp, Spaces) { } TEST(SplitUp, BadStrings) { - std::vector oput = {"one", "\" two three"}; + std::vector oput = {"one", " two three"}; std::string orig {" one \" two three "}; std::vector result = CLI::detail::split_up(orig); EXPECT_EQ(oput, result); - oput = {"one", "\' two three"}; + oput = {"one", " two three"}; orig = " one \' two three "; result = CLI::detail::split_up(orig); EXPECT_EQ(oput, result); diff --git a/tests/IniTest.cpp b/tests/IniTest.cpp index 16c532f5..38835865 100644 --- a/tests/IniTest.cpp +++ b/tests/IniTest.cpp @@ -331,8 +331,3 @@ TEST_F(TApp, IniOutputFlag) { EXPECT_THAT(str, Not(HasSubstr("nothing="))); } - -TEST_F(TApp, IniSpaces) { - - -}