From caab26247c8f336305b5e7ccfa23cf8c23869b7b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 28 Jul 2015 19:58:18 -0400 Subject: [PATCH] TW-1642: After "--", an apostrophe unexpectedly ends the task description - Thanks to Jeremy John Reeder. --- ChangeLog | 2 ++ src/CLI2.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0efc55134..d13eca096 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,8 @@ epoch 0. - TW-1641 'edit' should process or reject arguments (thanks to Daniel Shahaf). +- TW-1642 After "--", an apostrophe unexpectedly ends the task description + (thanks to Jeremy John Reeder). - Prevent potential task duplication during import for non-pending tasks. - Show the active context in "context list", if any is active. - Fix "task edit" dropping annotation text after newlines. diff --git a/src/CLI2.cpp b/src/CLI2.cpp index c75328e70..14ba61562 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -439,9 +439,13 @@ void CLI2::lexArguments () } else { + std::string quote = "'"; + std::string escaped = _original_args[i]; + str_replace (escaped, quote, "\\'"); + std::string::size_type cursor = 0; std::string word; - if (Lexer::readWord ("'" + _original_args[i] + "'", "'", cursor, word)) + if (Lexer::readWord (quote + escaped + quote, quote, cursor, word)) { Lexer::dequote (word); A2 unknown (word, Lexer::Type::word);