I found if Code::Blocks and windows both have the 'INCLUDE' variable that has '%INCLUDE%',
that will go into unfinished loop.
So you mean your Windows variable is something like:
INCLUDE=C:\include;%INCLUDE%
??? That would be a good reason for a loop... ;-)
Will check and properly fix that (although I don't see a good reason for doing such things...?!)...
With regards, Morten.
Hmmm... looking at the code:
// Value: First, expand stuff like:
// set PATH=%PATH%;C:\NewPath OR export PATH=$PATH:/new_path
// After, replace all macros the user might have used in addition
wxString the_value = value;
wxString value_set;
bool is_set = wxGetEnv(the_key, &value_set);
if (is_set)
{
wxString recursion;
if (platform::windows) recursion = _T("%")+the_key+_("%");
else recursion = _T("$")+the_key;
if (the_value.Contains(recursion))
the_value.Replace(recursion.c_str(), value_set.c_str());
}
Manager::Get()->GetMacrosManager()->ReplaceMacros(the_value);
I don't see a reason for such a loop except wxString's Replace method and/or MacrosManager... Thomas: (Because you are the macro expert:) Could this be an issue?!
With regards, Morten.
Manager::Get()->GetMacrosManager()->ReplaceMacros(the_value);
That line is the culprit - phew... so it's probably not my fault. ;-)
Thomas: To reproduce setup an envvar in Windows (not C::B) like:
RECURSION=C:\WhatEver;%RECURSION%
Then (re) start C::B and build a variable (e.g. an envvar) like: RECURSION=D:\WhoEver;%RECURSION% in C::B, apply it and restart C::B -> it freezes.
Now the funny part: If I apply the envvar (before restarting) the same steps are involved but it works properly. Is there anything different in MacrosManager on startup???
With regards, Morten.