Author Topic: PATH problem on windows with CB rev 4170  (Read 5246 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
PATH problem on windows with CB rev 4170
« on: June 25, 2007, 06:34:22 pm »
on windows platform the PATH environment variable is set to
Quote
.;$PATH

$PATH doesn't get expanded

the following program

Code
#include <windows.h>
#include <stdio.h>

int main(void) {

  printf("%s",getenv("path"));

  return 0;
}


run with CB 4172 returns
Quote
.;$PATH
Process returned 0 (0x0)   execution time : 0.015 s
Press any key to continue.

 8)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: PATH problem on windows with CB rev 4170
« Reply #1 on: June 25, 2007, 06:58:41 pm »
Thanks for pointing this out. Fixing it now...

Although I can't test the fix atm, I 've committed it and it should work again now.
« Last Edit: June 25, 2007, 08:52:49 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: PATH problem on windows with CB rev 4170
« Reply #2 on: June 26, 2007, 03:35:59 am »
sorry but it doesn't

now the path variable is set to
Quote
.;%PATH%

but the original setting is still lost

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: PATH problem on windows with CB rev 4170
« Reply #3 on: June 26, 2007, 04:38:26 am »
it works fine with the following patch

Code
Index: compilergcc.cpp
===================================================================
--- compilergcc.cpp (revision 4175)
+++ compilergcc.cpp (working copy)
@@ -96,13 +96,10 @@
 
 #if defined(__APPLE__) && defined(__MACH__)
     #define LIBRARY_ENVVAR _T("DYLD_LIBRARY_PATH")
-    #define LIBRARY_ENVVAR_DOLLAR _T("$") LIBRARY_ENVVAR
 #elif !defined(__WXMSW__)
     #define LIBRARY_ENVVAR _T("LD_LIBRARY_PATH")
-    #define LIBRARY_ENVVAR_DOLLAR _T("$") LIBRARY_ENVVAR
 #else
     #define LIBRARY_ENVVAR _T("PATH")
-    #define LIBRARY_ENVVAR_DOLLAR _T("%") LIBRARY_ENVVAR _T("%")
 #endif
 
 namespace
@@ -1188,7 +1185,7 @@
  newLibPath << GetStringFromArray(compiler->GetLinkerSearchDirs(cmd->target), libPathSep);
  if (newLibPath.SubString(newLibPath.Length() - 1, 1) != libPathSep)
  newLibPath << libPathSep;
- newLibPath << LIBRARY_ENVVAR_DOLLAR;
+ newLibPath << oldLibPath;
  wxSetEnv(LIBRARY_ENVVAR, newLibPath);
 // LogMessage(_T("LIBRARY_ENVVAR=") + newLibPath, cltInfo);
  }

and i guess it will work fine in linux and mac too,
but i can test it only on windows atm.

brgds tiwag

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: PATH problem on windows with CB rev 4170
« Reply #4 on: June 26, 2007, 09:58:07 am »
Thanks tiwag.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: PATH problem on windows with CB rev 4170
« Reply #5 on: June 26, 2007, 03:21:04 pm »
as usual M$ windoze needs extra treatment for pathes with spaces  :(

fixed in rev 4184