From 4ec1f1755722bb59cdcc8650efa91b7e4f127171 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 4 Nov 2014 22:34:18 -0500 Subject: [PATCH] CLI - More strict definition of what is a tag. --- src/CLI.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CLI.cpp b/src/CLI.cpp index 6d0ea5cc6..b0740ff68 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -28,6 +28,7 @@ #include #include #include // TODO Remove. +#include #include #include #include @@ -2065,10 +2066,15 @@ bool CLI::isCommand (const std::string& raw) const } //////////////////////////////////////////////////////////////////////////////// +// Valid tag +// - Length > 1 +// - Starts with +/- +// - Tag does not start with a digit bool CLI::isTag (const std::string& raw) const { if (raw.size () >= 2 && (raw[0] == '+' || raw[0] == '-') && + ! isdigit(raw[1]) && raw.find (' ') == std::string::npos) return true;