TI-2: Two line tags causes false entry in database

- Thanks to Sebastian Uharek.
This commit is contained in:
Paul Beckingham 2016-05-27 17:03:53 -04:00
parent 9f6baee790
commit e910506073
3 changed files with 10 additions and 1 deletions

View file

@ -21,3 +21,4 @@ suggestions:
Bruno Vernay Bruno Vernay
Ben Boeckel Ben Boeckel
Wade Duvall Wade Duvall
Sebastian Uharek

View file

@ -5,6 +5,8 @@
(thanks to Ben Boeckel). (thanks to Ben Boeckel).
- TD-115 Throw error when config file is missing or not readable - TD-115 Throw error when config file is missing or not readable
(thanks to Jelle van der Waa). (thanks to Jelle van der Waa).
- TI-2 Two line tags causes false entry in database
(thanks to Sebastian Uharek).
- Added 'continue' command. - Added 'continue' command.
- Added 'diagnostics' command. - Added 'diagnostics' command.
- Added 'export' command. - Added 'export' command.

View file

@ -133,7 +133,13 @@ void CLI::entity (const std::string& category, const std::string& name)
// Capture a single argument. // Capture a single argument.
void CLI::add (const std::string& argument) void CLI::add (const std::string& argument)
{ {
A2 arg (Lexer::trim (argument), Lexer::Type::word); // Sanitize the input: Convert control charts to spaces. Then trim.
auto clean = argument;
for (auto& c : clean)
if (c <= 32)
c = ' ';
A2 arg (Lexer::trim (clean), Lexer::Type::word);
arg.tag ("ORIGINAL"); arg.tag ("ORIGINAL");
_original_args.push_back (arg); _original_args.push_back (arg);