User forums > Help

A problem when copying the default.conf file from one computer to another

<< < (2/3) > >>

MortenMacFly:

--- Quote from: courage on June 14, 2007, 07:42:28 am ---And the one has 'INCLUDE' and 'LIB' variables may cause Code::Blocks into unfinished looping.

--- End quote ---
I can't reproduce: I tried many ways: having setup LIB only, having setup INCLUDE only, having setup both and having setup nothing. It just works as expected and in the case the variable already exists it is expanded as expected.


--- Quote from: courage on June 14, 2007, 07:42:28 am ---I also set 'PATH' variable in Code::Blocks and Code::Blocks works well.
Does Code::Blocks use different way to handle 'PATH' beyond other variables?

--- End quote ---
No it's the very same piece of code.

If you want to you could try to debug into this yourself. Do you have any global compiler variables and/or custom variables setup that could conflict (although they actually shouldn't)...?!

With regards, Morten.

courage:
Hello Morten:

I found if Code::Blocks and windows both have the 'INCLUDE' variable that has '%INCLUDE%',
that will go into unfinished loop.

Well... Hmm... could it be considered as a bug? :oops:

MortenMacFly:

--- Quote from: courage on June 14, 2007, 07:58:41 am ---I found if Code::Blocks and windows both have the 'INCLUDE' variable that has '%INCLUDE%',
that will go into unfinished loop.

--- End quote ---
So you mean your Windows variable is something like:

--- Code: ---INCLUDE=C:\include;%INCLUDE%

--- End code ---
??? 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.

MortenMacFly:
Hmmm... looking at the code:

--- 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);

--- End code ---
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.

MortenMacFly:

--- Quote from: MortenMacFly on June 14, 2007, 08:13:46 am ---
--- Code: ---  Manager::Get()->GetMacrosManager()->ReplaceMacros(the_value);

--- End code ---

--- End quote ---
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:

--- Code: ---  RECURSION=C:\WhatEver;%RECURSION%

--- End code ---
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version