Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
Nightly builds / Re: The 26 August 2026 build (13961) is out.
« Last post by ollydbg on Today at 06:42:00 am »
Thanks for sharing the new build! The switch to GCC 15.2.0 is interesting, and it's good to see fixes for dark mode and editor settings included. I'll make sure to check the nightly warnings before trying it. Has anyone noticed any compatibility issues with existing projects after updating?

spam reported.
2
Nightly builds / Re: The 26 August 2026 build (13961) is out.
« Last post by quiltedhai on Today at 03:35:32 am »
Thanks for sharing the new build! The switch to GCC 15.2.0 is interesting, and it's good to see fixes for dark mode and editor settings included. I'll make sure to check the nightly warnings before trying it. Has anyone noticed any compatibility issues with existing projects after updating?
3
Development / Re: special handling of the macro replacement ""?
« Last post by ollydbg on Today at 01:45:04 am »
Code
diff --git a/src/include/globals.h b/src/include/globals.h
index 8eab1bc2..25344464 100644
--- a/src/include/globals.h
+++ b/src/include/globals.h
@@ -228,12 +228,21 @@ extern DLLIMPORT wxString MakeUniqueString(const wxString& text,  const wxString
 extern DLLIMPORT void AppendArray(const wxArrayString& from, wxArrayString& to);
 
 extern DLLIMPORT wxString UnixFilename(const wxString& filename, wxPathFormat format = wxPATH_NATIVE);
 extern DLLIMPORT void QuoteStringIfNeeded(wxString& str);
 extern DLLIMPORT bool NeedQuotes(const wxString &str);
 
+/** \brief Remove all empty quote pairs (@c "" ) from a string.
+ *
+ * An empty quote pair is harmless inside a command line, the shell or the process
+ * launcher simply swallows it. It is fatal inside a path though, e.g. a global
+ * compiler variable defined as @c "" expands to @c ".../lib/gcc_dll""" which is not
+ * an existing directory when put into @c PATH .
+ */
+extern DLLIMPORT wxString cbStripEmptyQuotes(const wxString& str);
+
 /// Escapes spaces and tabs (NOT quoting the string)
 extern DLLIMPORT wxString EscapeSpaces(const wxString& str);
 
 extern DLLIMPORT FileType FileTypeOf(const wxString& filename);
 extern DLLIMPORT wxString cbFindFileInPATH(const wxString &filename);
 
diff --git a/src/plugins/debuggergdb/debuggergdb.cpp b/src/plugins/debuggergdb/debuggergdb.cpp
index 24facd91..e9cdc3da 100644
--- a/src/plugins/debuggergdb/debuggergdb.cpp
+++ b/src/plugins/debuggergdb/debuggergdb.cpp
@@ -897,13 +897,15 @@ int DebuggerGDB::DoDebug(bool breakOnEntry)
         {
             wxString newLibPath;
             const wxString libPathSep = platform::windows ? ";" : ":";
             newLibPath << "." << libPathSep;
 
             CompilerCommandGenerator *generator = actualCompiler->GetCommandGenerator(m_pProject);
-            newLibPath << GetStringFromArray(generator->GetLinkerSearchDirs(target), libPathSep);
+            // Strip empty quote pairs (e.g. from a global variable defined as ""), otherwise
+            // entries like "E:\wx\lib\gcc_dll""" end up in PATH and are not valid directories.
+            newLibPath << cbStripEmptyQuotes(GetStringFromArray(generator->GetLinkerSearchDirs(target), libPathSep));
             delete generator;
 
             if (newLibPath.Mid(newLibPath.Length() - 1, 1) != libPathSep)
                 newLibPath << libPathSep;
             newLibPath << oldLibPath;
             wxSetEnv(CB_LIBRARY_ENVVAR, newLibPath);
diff --git a/src/sdk/cbproject.cpp b/src/sdk/cbproject.cpp
index 9f6d363b..4bf60a0f 100644
--- a/src/sdk/cbproject.cpp
+++ b/src/sdk/cbproject.cpp
@@ -2033,13 +2033,15 @@ wxString cbGetDynamicLinkerPathForTarget(cbProject* project, ProjectBuildTarget*
         if (!generator)
               return wxEmptyString;
 
         wxString libPath;
         const wxString libPathSep = platform::windows ? ";" : ":";
         libPath << "." << libPathSep;
-        libPath << GetStringFromArray(generator->GetLinkerSearchDirs(target), libPathSep);
+        // Strip empty quote pairs (e.g. a global variable defined as ""), they would
+        // make the path entry invalid when used as PATH/LD_LIBRARY_PATH.
+        libPath << cbStripEmptyQuotes(GetStringFromArray(generator->GetLinkerSearchDirs(target), libPathSep));
         if (!libPath.IsEmpty() && libPath.Mid(libPath.Length() - 1, 1) == libPathSep)
             libPath.Truncate(libPath.Length() - 1);
 
         delete generator;
         return libPath;
     }
diff --git a/src/sdk/globals.cpp b/src/sdk/globals.cpp
index 0cde5347..87a7b653 100644
--- a/src/sdk/globals.cpp
+++ b/src/sdk/globals.cpp
@@ -270,12 +270,28 @@ bool NeedQuotes(const wxString &str)
 {
     bool hasSpace = str.Find(_T(' ')) != -1;
     bool hasParen = !platform::windows && (str.Find(_T('(')) != -1 || str.Find(_T(')')) != -1);
     return !str.IsEmpty() && str.GetChar(0) != _T('"') && (hasSpace || hasParen);
 }
 
+wxString cbStripEmptyQuotes(const wxString& str)
+{
+    if (str.Find(_T('"')) == wxNOT_FOUND)
+        return str;
+
+    // An empty quote pair ("") is swallowed by the shell/process launcher, so it does
+    // not hurt in a command line. In a path used as an environment variable (PATH,
+    // LD_LIBRARY_PATH) it makes the whole entry invalid, so remove all of them.
+    wxString result(str);
+    // Repeat, because there can be more than one pair (or nested ones).
+    while (result.Replace("\"\"", wxEmptyString, true) != 0)
+        ;
+
+    return result;
+}
+
 wxString EscapeSpaces(const wxString& str)
 {
     wxString ret = str;
     if (!ret.IsEmpty() && ret[0] != _T('"') && ret[0] != _T('\''))
     {
         // TODO: make it faster
diff --git a/src/sdk/uservarmanager.cpp b/src/sdk/uservarmanager.cpp
index f7c38584..5661c5e4 100644
--- a/src/sdk/uservarmanager.cpp
+++ b/src/sdk/uservarmanager.cpp
@@ -190,13 +190,18 @@ wxString UserVariableManager::Replace(const wxString& variable, std::vector<wxSt
 
             std::set<wxString> ar = {varName};
             m_ui->OpenEditWindow(ar);
             Reload();
         }
     }
-    return value;
+
+    // A variable is sometimes defined as "" (an empty quote pair) just to make
+    // $(#var) expand to nothing. Drop those empty quote pairs here, so that they
+    // can't leak into paths, e.g. "$(#wx.lib)/gcc_dll$(#wx.cfg)" turning into
+    // ".../gcc_dll""" which is an invalid directory when put into PATH.
+    return cbStripEmptyQuotes(value);
 }
 
 std::vector<wxString> UserVariableManager::GetVariableSetNames() const
 {
     std::vector<wxString> names;
     names.reserve(m_VariableSetMap.size());


I'm testing above patch, it try to remove all the "" in the macro replacement in string generation, also in the compiler and debugger plugin.


EDIT:

The patch works fine.
4
I am new, I am here
5
Development / Re: Disappearance of an old modification in 'r13960'
« Last post by Miguel Gimenez on Yesterday at 01:23:34 pm »
Profile spammer reported to moderator.
6
Development / Re: SVN14057 - UserTemplates - annoying bug - diff patch
« Last post by denimjeans2007 on Yesterday at 01:02:26 pm »
this is fixed with SVN14059
thanks to the CodeBlocks developer team !!

Regards,
OktayO
7
Development / Re: Disappearance of an old modification in 'r13960'
« Last post by remino on Yesterday at 09:52:27 am »
I believed I could fix it.
8
Development / Re: special handling of the macro replacement ""?
« Last post by ollydbg on Yesterday at 06:24:13 am »
It looks like I still see this issue in the recent C::B.

I have defined one of the global variable "wxWidgets.wx_cfg" as something like "".

I found that the building stage works correct.

Something like this in the compiler build log:

Code
[ 33.3%] g++.exe -Wall -std=gnu++20 -m64 -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -D_WIN64 -D__WX__ -DWINVER=0x0501 -DLINK_LEXERS -DSCI_LEXER -DWXMAKINGDLL_SCI -std=gnu++20 -iquote.objs33_64\include -I.objs33_64\include -I. -IE:\code\wxWidgets-3.3.4\include -IE:\code\wxWidgets-3.3.4\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Isdk\wxscintilla\src\scintilla\include -Isdk\wxscintilla\src\scintilla\src -Isdk\wxscintilla\src\scintilla\lexlib -c D:\code\cb\cb_sf_git\cccrash2019\src\sdk\wxscintilla\src\PlatWX.cpp -o .objs33_64\sdk\wxscintilla\src\PlatWX.o

You can see that the
Code
-IE:\code\wxWidgets-3.3.4\lib\gcc_dll""\mswu

But when I try to start the debugger, it just failed to find the wx's dll, the debugger log:

Code
Set variable: PATH=.;E:\code\wxWidgets-3.3.4\lib\gcc_dll"";D:\code\cb\cb_sf_git\cccrash2019\src\devel33_64;D:\code\cb\cb_sf_git\cccrash2019\src\exchndl\win64\lib;F:\msys2\mingw64\bin;F:\msys2\mingw64;...

[debug]Command-line: F:\code\gdb-14.1.90.20231204-x86_64-python\bin\gdb.exe -nx -fullname -quiet  -args D:/code/cb/cb_sf_git/cccrash2019/src/devel33_64/codeblocks.exe
[debug]Working dir : D:\code\cb\cb_sf_git\cccrash2019\src\devel33_64


You can see that the "PATH" command failed to add the path "E:\code\wxWidgets-3.3.4\lib\gcc_dll".

So, I think I still need to find a way to "remove" the double quote in the command generation. Or, I need to make this "wxWidgets.wx_cfg" as empty, not the "".

9
Development / Re: SVN14057 - UserTemplates - annoying bug - diff patch
« Last post by denimjeans2007 on Yesterday at 12:25:11 am »
update: next ticket 1663 opened: https://sourceforge.net/p/codeblocks/tickets/1663 incl the patch
10
Development / SVN14057 - UserTemplates - annoying bug - diff patch
« Last post by denimjeans2007 on October 24, 2026, 10:17:57 pm »
Hi everyone, I have found an annoying bug which prevents users from using their own templates.
It's described here:
https://forums.codeblocks.org/index.php/topic,26379.15.html
and i opened a ticket #1661 https://sourceforge.net/p/codeblocks/tickets/1661/. The bug should have been fixedwith 14057 but it is not. I have checked the code and found the attached solution working. Tested / compiled with SVN 14057, the bug is gone when using the attached patch. Since I dont know how to contribute the patch to the developers, I am posting it here, in the hope that someone from the developers will review it and if thats fine, implement it.

Regards,
OktayO
Pages: [1] 2 3 4 5 6 ... 10