# HG changeset patch # User František Kučera # Date 1606594033 -3600 # Node ID f0bf2755249fe762e7855d80dfba356a36c277cc # Parent 596a724fbb834f2f0139bca38c9d45bdaba7e606 remove BackspaceDisorder unescaping diff -r 596a724fbb83 -r f0bf2755249f src/INICommand.cpp --- a/src/INICommand.cpp Sat Nov 28 20:59:29 2020 +0100 +++ b/src/INICommand.cpp Sat Nov 28 21:07:13 2020 +0100 @@ -175,7 +175,6 @@ std::shared_ptr reader(INIReader::create(input)); reader->addUnescapingProcessor(std::make_shared(), unescaping::Basic, true); reader->addUnescapingProcessor(std::make_shared(), unescaping::JavaProperties, false); - reader->addUnescapingProcessor(std::make_shared(false), unescaping::BackspaceDisorder, false); reader->addUnescapingProcessor(std::make_shared(), unescaping::Backspace, true); reader->addDialect(std::make_shared(), dialect::JavaProperties, false); reader->addHandler(&handler); diff -r 596a724fbb83 -r f0bf2755249f src/lib/BackspaceUnescapingProcessor.h --- a/src/lib/BackspaceUnescapingProcessor.h Sat Nov 28 20:59:29 2020 +0100 +++ b/src/lib/BackspaceUnescapingProcessor.h Sat Nov 28 21:07:13 2020 +0100 @@ -30,6 +30,14 @@ class BackspaceUnescapingProcessor : public UnescapingProcessor { private: + /** + * By default it is set to true, thus no unrecognized escape sequences may left after this stage. + * Setting this to false is dangerous and may lead to errors and ambiguous behavior. + * It should be used only as a last resort. + * Because both "\\ \xxx" and "\ \xxx" will be converted to "\ \xxx" and the information will be lost. + * So, it is usually better to keep the "\" escaped as "\\" and process both the escaped backspaces and unrecognized escape sequences later. + */ + const bool lastEscaphingPhase = true; public: @@ -51,17 +59,6 @@ return result.str(); } - /** - * @param lastEscaphingPhase whether this is final unescaping stage. - * By default it is set to true, thus no unrecognized escape sequences may left after this stage. - * Setting this to false is dangerous and may lead to errors and ambiguous behavior. - * It should be used only as a last resort. - * Because both "\\ \xxx" and "\ \xxx" will be converted to "\ \xxx" and the information will be lost. - * So, it is usually better to keep the "\" escaped as "\\" and process both the escaped backspaces and unrecognized escape sequences later. - */ - BackspaceUnescapingProcessor(bool lastEscaphingPhase = true) : lastEscaphingPhase(lastEscaphingPhase) { - } - }; } diff -r 596a724fbb83 -r f0bf2755249f src/lib/uri.h --- a/src/lib/uri.h Sat Nov 28 20:59:29 2020 +0100 +++ b/src/lib/uri.h Sat Nov 28 21:07:13 2020 +0100 @@ -37,7 +37,6 @@ namespace unescaping { static const char* Basic = "unescape-basic"; static const char* JavaProperties = "unescape-java-properties"; -static const char* BackspaceDisorder = "unescape-backspace-disorder"; // TODO: remove BackspaceDisorder static const char* Backspace = "unescape-backspace"; }