mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 04:17:53 +01:00
Add new substitute_env_variables parameter for DefaultReplacements function (with default true value)
This commit is contained in:
parent
add67ca0e3
commit
627fd6bce1
@ -653,7 +653,7 @@ interface
|
||||
function getrealtime(const st: TSystemTime) : real;
|
||||
function getrealtime : real;
|
||||
|
||||
procedure DefaultReplacements(var s:ansistring);
|
||||
procedure DefaultReplacements(var s:ansistring; substitute_env_variables:boolean=true);
|
||||
|
||||
function GetEnvPChar(const envname:ansistring):pchar;
|
||||
procedure FreeEnvPChar(p:pchar);
|
||||
@ -952,7 +952,7 @@ implementation
|
||||
****************************************************************************}
|
||||
|
||||
|
||||
procedure DefaultReplacements(var s:ansistring);
|
||||
procedure DefaultReplacements(var s:ansistring; substitute_env_variables:boolean=true);
|
||||
{$ifdef mswindows}
|
||||
procedure ReplaceSpecialFolder(const MacroName: string; const ID: integer);
|
||||
begin
|
||||
@ -1024,6 +1024,8 @@ implementation
|
||||
Replace(s,'$OPENBSD_LOCALBASE',GetOpenBSDLocalBase);
|
||||
Replace(s,'$OPENBSD_X11BASE',GetOpenBSDX11Base);
|
||||
{$endif openbsd}
|
||||
if not substitute_env_variables then
|
||||
exit;
|
||||
{ Replace environment variables between dollar signs }
|
||||
i := pos('$',s);
|
||||
while i>0 do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user