mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 17:39:18 +02:00
IDE: made GetProgramSearchPath a function, Delim can be replaced with System.PathSep
git-svn-id: trunk@12379 -
This commit is contained in:
parent
b77db7a61d
commit
db339f6b42
@ -209,7 +209,7 @@ function StringListPartToText(List: TStrings; FromIndex, ToIndex: integer;
|
|||||||
// environment
|
// environment
|
||||||
function GetCurrentUserName: string;
|
function GetCurrentUserName: string;
|
||||||
function GetCurrentMailAddress: string;
|
function GetCurrentMailAddress: string;
|
||||||
procedure GetProgramSearchPath(var SearchPath: string; out Delim: char);
|
function GetProgramSearchPath: string;
|
||||||
function ProgramDirectory: string;
|
function ProgramDirectory: string;
|
||||||
|
|
||||||
// debugging
|
// debugging
|
||||||
@ -1530,8 +1530,6 @@ function FindProgram(const Programname, BaseDirectory: string;
|
|||||||
WithBaseDirectory: boolean): string;
|
WithBaseDirectory: boolean): string;
|
||||||
var
|
var
|
||||||
Flags: TSearchFileInPathFlags;
|
Flags: TSearchFileInPathFlags;
|
||||||
SearchPath: string;
|
|
||||||
Delim: char;
|
|
||||||
begin
|
begin
|
||||||
if FilenameIsAbsolute(Programname) then begin
|
if FilenameIsAbsolute(Programname) then begin
|
||||||
if FileExists(Programname) then
|
if FileExists(Programname) then
|
||||||
@ -1543,9 +1541,8 @@ begin
|
|||||||
Flags:=[];
|
Flags:=[];
|
||||||
if not WithBaseDirectory then
|
if not WithBaseDirectory then
|
||||||
Include(Flags,sffDontSearchInBasePath);
|
Include(Flags,sffDontSearchInBasePath);
|
||||||
GetProgramSearchPath(SearchPath,Delim);
|
Result:=FileUtil.SearchFileInPath(Programname,BaseDirectory,
|
||||||
Result:=FileUtil.SearchFileInPath(Programname,BaseDirectory,SearchPath,
|
GetProgramSearchPath,PathSep,Flags);
|
||||||
Delim,Flags);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function DateToCfgStr(const Date: TDateTime): string;
|
function DateToCfgStr(const Date: TDateTime): string;
|
||||||
@ -2214,10 +2211,9 @@ begin
|
|||||||
Result:='<'+GetCurrentUserName+'@'+GetEnvironmentVariable('HOSTNAME')+'>';
|
Result:='<'+GetCurrentUserName+'@'+GetEnvironmentVariable('HOSTNAME')+'>';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetProgramSearchPath(var SearchPath: string; out Delim: char);
|
function GetProgramSearchPath: string;
|
||||||
begin
|
begin
|
||||||
SearchPath:=GetEnvironmentVariable('PATH');
|
GetProgramSearchPath := GetEnvironmentVariable('PATH');
|
||||||
Delim:=':';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user