diff --git a/src/CLI.cpp b/src/CLI.cpp index 67f602aac..01ebac8f1 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -849,7 +849,7 @@ void CLI::categorize () a->tag ("MODIFICATION"); // If the argument contains a space, it was quoted. Record that. - if (! noSpaces (raw)) + if (! Lexer::isOneWord (raw)) a->tag ("QUOTED"); changes = true; @@ -859,7 +859,7 @@ void CLI::categorize () a->tag ("FILTER"); // If the argument contains a space, it was quoted. Record that. - if (! noSpaces (raw)) + if (! Lexer::isOneWord (raw)) a->tag ("QUOTED"); changes = true; diff --git a/src/text.cpp b/src/text.cpp index c68d65b5b..cf9c9ada3 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -489,18 +489,6 @@ bool digitsOnly (const std::string& input) return true; } -//////////////////////////////////////////////////////////////////////////////// -bool noSpaces (const std::string& input) -{ - std::string::size_type i = 0; - int character; - while ((character = utf8_next_char (input, i))) - if (Lexer::isWhitespace (character)) - return false; - - return true; -} - //////////////////////////////////////////////////////////////////////////////// // Override of ispunct, that considers #, $ and @ not to be punctuation. // diff --git a/src/text.h b/src/text.h index 68f8ea78e..2e9036648 100644 --- a/src/text.h +++ b/src/text.h @@ -51,7 +51,6 @@ const std::string str_replace (const std::string&, const std::string&, const std const char* optionalBlankLine (); bool nontrivial (const std::string&); bool digitsOnly (const std::string&); -bool noSpaces (const std::string&); bool isPunctuation (char); bool compare (const std::string&, const std::string&, bool sensitive = true); bool closeEnough (const std::string&, const std::string&, unsigned int minLength = 0); diff --git a/test/text.t.cpp b/test/text.t.cpp index 1034c2029..9cb99bf65 100644 --- a/test/text.t.cpp +++ b/test/text.t.cpp @@ -37,7 +37,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (214); + UnitTest t (209); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -296,13 +296,6 @@ int main (int argc, char** argv) t.ok (digitsOnly ("123"), "digitsOnly '123' -> true"); t.notok (digitsOnly ("12fa"), "digitsOnly '12fa' -> false"); - // bool noSpaces (const std::string&); - t.ok (noSpaces (""), "noSpaces '' -> true"); - t.ok (noSpaces ("a"), "noSpaces 'a' -> true"); - t.ok (noSpaces ("abc"), "noSpaces 'abc' -> true"); - t.notok (noSpaces (" "), "noSpaces ' ' -> false"); - t.notok (noSpaces ("ab cd"), "noSpaces 'ab cd' -> false"); - // bool compare (const std::string&, const std::string&, bool caseless = false); // Make sure degenerate cases are handled. t.ok (compare ("", ""), "'' == ''");