summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 469fea0)
raw | patch | inline | side by side (parent: 469fea0)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 21 Oct 2019 03:24:43 +0000 (06:24 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 21 Oct 2019 03:25:37 +0000 (06:25 +0300) |
src/game/g_main.pas | patch | blob | history |
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 9a4e345d0206945099bdecbdbdb02275177283d9..0e349afbbdc61f35e582f3c00d6bf7bcaf147bae 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
begin
end;
- procedure AddPath (var arr: SSArray; str: AnsiString);
+ procedure AddPath (var arr: SSArray; str: AnsiString; usecwd: Boolean=true);
var
ss: ShortString;
begin
if (length(str) = 0) then exit;
- if (forceCurrentDir) then
+ //writeln('NEW PATH(0): ['+str+']');
+ if (forceCurrentDir or usecwd) then
begin
str := fixSlashes(ExpandFileName(str));
end
else
begin
str := fixSlashes(str);
- if (str[1] <> '/') then str := binPath+str;
+ if (not isAbsolutePath(str)) then str := binPath+str;
while (length(str) > 0) do
begin
- if (str = '/') then exit;
+ if (isRootPath(str)) then exit;
if (str[length(str)] = '/') then begin Delete(str, length(str), 1); continue; end;
if (length(str) >= 2) and (Copy(str, length(str)-1, 2) = '/.') then begin Delete(str, length(str)-1, 2); continue; end;
break;
SetLength(arr, Length(arr)+1);
//arr[High(arr)] := ExpandFileName(str);
arr[High(arr)] := str;
- xput('NEW PATH: ['+str+']');
+ //writeln('NEW PATH(1): ['+str+']');
end;
procedure AddDef (var arr: SSArray; str: AnsiString);
begin
- if (length(arr) = 0) then AddPath(arr, str)
+ if (length(arr) = 0) then AddPath(arr, str, false)
end;
begin