commit 0ec9e99ff47795257df250c97adfa9b356502ce2 Author: Daniel Swanson Date: Sat Jul 17 21:25:48 2021 -0500 also escape special characters at the end of a string diff --git a/apertium/transfer_regex.cc b/apertium/transfer_regex.cc index 642caad..6698254 100644 --- a/apertium/transfer_regex.cc +++ b/apertium/transfer_regex.cc @@ -52,6 +52,9 @@ unbuildTrie(TrieNode* root) int single_count = 0; for (auto it : root->next) { if (it->end && it->next.empty()) { + if (it->c == '+' || it->c == '*' || it->c == '?' || it->c == '.') { + single += '\\'; + } single += it->c; single_count++; } else {