46720043319758cb0e798eb23520063583c40eaa.patch 1.8 KB

12345678910111213141516171819202122232425262728293031
  1. From 46720043319758cb0e798eb23520063583c40eaa Mon Sep 17 00:00:00 2001
  2. From: fuscated <fuscated@2a5c6006-c6dd-42ca-98ab-0921f2732cef>
  3. Date: Sun, 15 Aug 2021 11:51:11 +0000
  4. Subject: [PATCH] * SDK: Fix a regex in the MacroManager to work with the PCRE2
  5. regex engine used by wx3.1.6 (ticket #1120)
  6. > This regex is totally bonkers. I don't know what its purpose is, but it
  7. is mighty strange. There is a group at the beginning which tries to match
  8. non-$ or start of the string. At the end there is code to match ' ', '/'
  9. or '\'. The braces could be mismatched - ${var) works perfectly fine.
  10. > The fix is - we want to match '\', so we need to escape it.
  11. git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@12511 2a5c6006-c6dd-42ca-98ab-0921f2732cef
  12. ---
  13. src/sdk/macrosmanager.cpp | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/src/sdk/macrosmanager.cpp b/src/sdk/macrosmanager.cpp
  16. index 4027d1974..086dc35cd 100644
  17. --- a/src/sdk/macrosmanager.cpp
  18. +++ b/src/sdk/macrosmanager.cpp
  19. @@ -80,7 +80,7 @@ void MacrosManager::Reset()
  20. m_Plugins = UnixFilename(ConfigManager::GetPluginsFolder());
  21. m_DataPath = UnixFilename(ConfigManager::GetDataFolder());
  22. ClearProjectKeys();
  23. - m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[)} /\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
  24. + m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[\\)} /\\\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
  25. m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE);
  26. m_RE_IfSp.Compile(_T("(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
  27. m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);