Skip to content

Commit

Permalink
Update p.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzying2001 committed Feb 6, 2023
1 parent 5a80e00 commit ce11ab3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/p.pas
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ procedure CreateDirOfFile(filePath: string);
dir: string;
begin
for i := 0 to Length(filePath) - 1 do
if filePath[i] = '\' then
if (filePath[i] = '\') or (filePath[i] = '/') then
begin
dir := filePath.Substring(0, i);
if not DirectoryExists(dir) then
Expand Down Expand Up @@ -169,8 +169,7 @@ function Unpak(inputPath: string; outputPath: string): boolean;
exit;
end;

outputPath := outputPath.Replace('/', '\');
if not outputPath.EndsWith('\') then
if not (outputPath.EndsWith('\') or outputPath.EndsWith('/')) then
outputPath := outputPath + '\';

try
Expand Down Expand Up @@ -288,8 +287,7 @@ function Pak(inputPath: string; outputPath: string): boolean;
exit;
end;

inputPath := inputPath.Replace('/', '\');
if not inputPath.EndsWith('\') then
if not (inputPath.EndsWith('\') or inputPath.EndsWith('/')) then
inputPath := inputPath + '\';

try
Expand Down

0 comments on commit ce11ab3

Please sign in to comment.