codeblocks: fix a crash on startup

Fix: #47691
This commit is contained in:
Đoàn Trần Công Danh 2023-12-12 22:31:14 +07:00
parent 99b9914c2e
commit fe3d23ebe8
3 changed files with 45 additions and 1 deletions

View file

@ -0,0 +1,29 @@
--- a/src/plugins/contrib/FileManager/FileExplorer.cpp
+++ b/src/plugins/contrib/FileManager/FileExplorer.cpp
@@ -812,7 +812,7 @@ void FileExplorer::WriteConfig()
wxString ref=wxString::Format(_T("FileExplorer/RootList/I%i"),i);
cfg->Write(ref, m_Loc->GetString(m_favdirs.GetCount()+i));
}
- count=static_cast<int>(m_Loc->GetCount());
+ count=static_cast<int>(m_WildCards->GetCount());
cfg->Write(_T("FileExplorer/WildMask/Len"), count);
for(int i=0;i<count;i++)
{
--- a/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
+++ b/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
@@ -150,7 +150,14 @@ void FileExplorerUpdater::Update(const w
m_path=wxString(m_fe->GetFullPath(ti).c_str());
m_wildcard=wxString(m_fe->m_WildCards->GetValue().c_str());
m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str());
- m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
+ if (m_fe->m_VCS_Control->GetSelection() == wxNOT_FOUND)
+ {
+ m_vcs_commit_string = "";
+ }
+ else
+ {
+ m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
+ }
m_vcs_changes_only = m_fe->m_VCS_ChangesOnly->IsChecked();
if (m_vcs_type != wxEmptyString)
m_repo_path=wxString(m_fe->GetRootFolder().c_str());

View file

@ -0,0 +1,14 @@
--- a/src/sdk/macrosmanager.cpp
+++ b/src/sdk/macrosmanager.cpp
@@ -83,9 +83,9 @@ void MacrosManager::Reset()
m_Plugins = UnixFilename(ConfigManager::GetPluginsFolder());
m_DataPath = UnixFilename(ConfigManager::GetDataFolder());
ClearProjectKeys();
- m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[)} /\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
+ m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[\\)} \\/\\\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE);
m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE);
- m_RE_If.Compile(_T("\\$if\\(([^)]*)\\)[::space::]*(\\{([^}]*)\\})(\\{([^}]*)\\})?"), wxRE_EXTENDED | wxRE_NEWLINE);
+ m_RE_If.Compile(_T("\\$if\\(([^)]*)\\)\\s*(\\{([^}]*)\\})(\\{([^}]*)\\})?"), wxRE_EXTENDED | wxRE_NEWLINE);
m_RE_IfSp.Compile(_T("[^=!<>]+|(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);
m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"),

View file

@ -1,7 +1,7 @@
# Template file for 'codeblocks'
pkgname=codeblocks
version=20.03
revision=6
revision=7
build_style=gnu-configure
configure_args="--with-wx-config=wx-config-gtk3 --with-contrib-plugins
--with-boost=${XBPS_CROSS_BASE}/usr
@ -16,6 +16,7 @@ license="GPL-3.0-only"
homepage="http://www.codeblocks.org"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/Sources/${version}/${pkgname}-${version}.tar.xz"
checksum=15eeb3e28aea054e1f38b0c7f4671b4d4d1116fd05f63c07aa95a91db89eaac5
disable_parallel_build="plugins use same working directory"
CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"