Skip to content
Snippets Groups Projects
Commit 4c3f7d4a authored by Per Hedbor's avatar Per Hedbor
Browse files

Added normalize_path (it is needed on NT to avoid things like c:\foo\bar _and_...

Added normalize_path (it is needed on NT to avoid things like c:\foo\bar _and_ c:/foo\bar to be in the module path at the same time, thus creating spurious joinnode-modules)

Rev: lib/master.pike.in:1.116
parent 05e2666d
No related branches found
No related tags found
No related merge requests found
/* -*- Pike -*- /* -*- Pike -*-
* *
* $Id: master.pike.in,v 1.115 2000/04/12 18:39:38 hubbe Exp $ * $Id: master.pike.in,v 1.116 2000/04/13 18:54:16 per Exp $
* *
* Master-file for Pike. * Master-file for Pike.
* *
...@@ -204,23 +204,31 @@ void putenv(string var, string val) ...@@ -204,23 +204,31 @@ void putenv(string var, string val)
environment[var]=val; environment[var]=val;
} }
string normalize_path( string X )
{
#ifndef __NT__
return X;
#else
return replace(X,"\\","/");
#endif
}
void add_include_path(string tmp) void add_include_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_include_path-=({tmp}); pike_include_path-=({tmp});
pike_include_path=({tmp})+pike_include_path; pike_include_path=({tmp})+pike_include_path;
} }
void remove_include_path(string tmp) void remove_include_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_include_path-=({tmp}); pike_include_path-=({tmp});
} }
void add_module_path(string tmp) void add_module_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_module_path-=({tmp}); pike_module_path-=({tmp});
pike_module_path=({tmp})+pike_module_path; pike_module_path=({tmp})+pike_module_path;
} }
...@@ -228,14 +236,14 @@ void add_module_path(string tmp) ...@@ -228,14 +236,14 @@ void add_module_path(string tmp)
void remove_module_path(string tmp) void remove_module_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_module_path-=({tmp}); pike_module_path-=({tmp});
} }
void add_program_path(string tmp) void add_program_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_program_path-=({tmp}); pike_program_path-=({tmp});
pike_program_path=({tmp})+pike_program_path; pike_program_path=({tmp})+pike_program_path;
} }
...@@ -243,7 +251,7 @@ void add_program_path(string tmp) ...@@ -243,7 +251,7 @@ void add_program_path(string tmp)
void remove_program_path(string tmp) void remove_program_path(string tmp)
{ {
tmp=combine_path_with_cwd(tmp); tmp=normalize_path(combine_path_with_cwd(tmp));
pike_program_path-=({tmp}); pike_program_path-=({tmp});
} }
...@@ -495,7 +503,7 @@ constant master_efuns = ({ ...@@ -495,7 +503,7 @@ constant master_efuns = ({
"describe_error", "describe_error",
"new", "new",
"clone", "clone",
"normalize_path",
"getenv", "getenv",
"putenv", "putenv",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment