|
@@ -66,22 +66,27 @@ begin
|
|
l:=Length(FileName);
|
|
l:=Length(FileName);
|
|
if (l<2) then
|
|
if (l<2) then
|
|
exit;
|
|
exit;
|
|
|
|
+{$IF DEFINED(AMIGA) OR DEFINED(MORPHOS)}
|
|
|
|
+ i:=Pos(DriveSeparator,FileName);
|
|
|
|
+ if (i > 0) then Result:=Copy(FileName,1,i-1);
|
|
|
|
+{$ELSE}
|
|
If (FileName[2] in AllowDriveSeparators) then
|
|
If (FileName[2] in AllowDriveSeparators) then
|
|
result:=Copy(FileName,1,2)
|
|
result:=Copy(FileName,1,2)
|
|
else if (FileName[1] in AllowDirectorySeparators) and
|
|
else if (FileName[1] in AllowDirectorySeparators) and
|
|
(FileName[2] in AllowDirectorySeparators) then
|
|
(FileName[2] in AllowDirectorySeparators) then
|
|
begin
|
|
begin
|
|
i := 2;
|
|
i := 2;
|
|
-
|
|
|
|
- { skip share }
|
|
|
|
|
|
+
|
|
|
|
+ { skip share }
|
|
While (i<l) and Not (Filename[i+1] in AllowDirectorySeparators) do
|
|
While (i<l) and Not (Filename[i+1] in AllowDirectorySeparators) do
|
|
inc(i);
|
|
inc(i);
|
|
inc(i);
|
|
inc(i);
|
|
-
|
|
|
|
|
|
+
|
|
While (i<l) and Not (Filename[i+1] in AllowDirectorySeparators) do
|
|
While (i<l) and Not (Filename[i+1] in AllowDirectorySeparators) do
|
|
inc(i);
|
|
inc(i);
|
|
Result:=Copy(FileName,1,i);
|
|
Result:=Copy(FileName,1,i);
|
|
end;
|
|
end;
|
|
|
|
+{$ENDIF}
|
|
end;
|
|
end;
|
|
|
|
|
|
function ExtractFileName(const FileName: string): string;
|
|
function ExtractFileName(const FileName: string): string;
|