taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Fix escape character escaping as described in #1693

Open DanielMowitz opened this issue 3 years ago • 1 comments

Description

The fix is achieved by splitting the Lexer::readWord function into multiple parts and calling only the necessary one in CLI2.cpp.

Additional information...

I was not completely sure about the naming of the new functions and would like to discuss that in this PR. Since I am also still in the process of writing a new test for #1693, there is no test suite run attached.

DanielMowitz avatar Jun 12 '22 09:06 DanielMowitz

A test for the original issue has been created.

All other tests now pass as well. Sadly, part of the code introduced to accomplish this is rather ad-hoc. This is because task add seemingly relies on readWord to escape unicode characters, but not backslash escapes. These seem to get handled elsewhere, with the exception of \'and \", which needed to be done manually. I'm not fairly happy with this, but it works.

DanielMowitz avatar Jul 06 '22 21:07 DanielMowitz