Skip to content

Commit

Permalink
Замена PathSeparator на ';'
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Dec 27, 2024
1 parent ed0f33a commit 50aaac7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cad_source/components/zebase/uzbpaths.pas
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ interface
//подстановка макросов в APath
function ExpandPath(APath:String;AItDirectory:boolean=false):String;

//поиск файла по списку путей разделенных PathSeparator
//поиск файла по списку путей разделенных ';'
function FindInPaths(const APaths:String; const AFileName:String):String;

//DistroPath - путь к дистрибутиву программы, это /etc/zcad/ или
//ExtractFilePath(paramstr(0))+'../..' в зависимости где фактически лежат
//файлы дистрибутива и что найдет FindDistroPath

//DataPaths - пути данных программы, сейчас их 2, разделены PathSeparator
//DataPaths - пути данных программы, сейчас их 2, разделены ';'
//1: /home/user/.config/zcad/
//2: DistroPath
//всё ищется сначала в 1, потом в 2
Expand Down Expand Up @@ -115,11 +115,11 @@ procedure AddToAdditionalSupportPaths(const APath:String);
if AdditionalSupportPaths='' then
AdditionalSupportPaths:=APath
else
if (AdditionalSupportPaths[Length(AdditionalSupportPaths)]=PathSeparator)or
(APath[1]=PathSeparator) then
if (AdditionalSupportPaths[Length(AdditionalSupportPaths)]=';')or
(APath[1]=';') then
AdditionalSupportPaths:=AdditionalSupportPaths+APath
else
AdditionalSupportPaths:=AdditionalSupportPaths+PathSeparator+APath;
AdditionalSupportPaths:=AdditionalSupportPaths+';'+APath;
end;

function GetSupportPaths:String;
Expand All @@ -133,7 +133,7 @@ function GetSupportPaths:String;
if SupportPaths[Length(SupportPaths)]=DirectorySeparator then
result:=SupportPaths+AdditionalSupportPaths
else
result:=SupportPaths+PathSeparator+AdditionalSupportPaths
result:=SupportPaths+';'+AdditionalSupportPaths
end;
function GetBinPath:String;
begin
Expand Down Expand Up @@ -180,7 +180,7 @@ function FindFileInDataPaths(const ASubFolder:String;const AFileName:String):Str
end;
function GetPathsInDataPaths(const ASubFolder:String):String;
begin
result:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(GetAppConfigDir(false))+ASubFolder)+PathSeparator
result:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(GetAppConfigDir(false))+ASubFolder)+';'
+IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(DistroPath)+ASubFolder);
end;

Expand Down Expand Up @@ -220,7 +220,7 @@ function FindInPaths(const APaths:String; const AFileName:String):String;
end;
s:=ExpandPath(APaths);
repeat
GetPartOfPath(ts,s,PathSeparator);
GetPartOfPath(ts,s,';');
zTraceLn('[FILEOPS]FindInPaths: searh in "%s"',[UTF8ToSys(ts)]);
ts2:=ts+ExpandedFileName;
if FileExists(UTF8ToSys(ts2))then begin
Expand Down Expand Up @@ -308,7 +308,7 @@ procedure FromDirsIterator(const APath,AMask,AFirstLoadFileName:String;AProc:TFr
pvs:=nil;
s:=APath;
repeat
GetPartOfPath(ts,s,PathSeparator);
GetPartOfPath(ts,s,';');
ts:=ExpandPath(ts);
FromDirIteratorInternal(ts,AMask,AFirstLoadFileName,AProc,AMethod,APData,pvs);
until s='';
Expand Down

0 comments on commit 50aaac7

Please sign in to comment.