mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-06 16:50:38 +01:00
* extended fix for web bug #12370 (more platforms supported and slightly more universal)
git-svn-id: trunk@12381 -
This commit is contained in:
parent
499c523346
commit
088c441d9d
@ -504,17 +504,33 @@ implementation
|
||||
begin
|
||||
result:=false;
|
||||
{$if defined(unix)}
|
||||
if (length(s)>0) and (s[1]='/') then
|
||||
if (length(s)>0) and (s[1] in AllowDirectorySeparators) then
|
||||
result:=true;
|
||||
{$elseif defined(amiga) or defined(morphos)}
|
||||
if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or (Pos(':',s) = length(s)) then
|
||||
if ((length(s)>0) and (s[1] in AllowDirectorySeparators)) or (Pos(':',s) = length(s)) then
|
||||
result:=true;
|
||||
{$elseif defined(macos)}
|
||||
if IsMacFullPath(s) then
|
||||
result:=true;
|
||||
{$elseif defined(win32) or defined(win64) or defined(go32v2)}
|
||||
if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or
|
||||
((length(s)>2) and (s[2]=':') and ((s[3]='\') or (s[3]='/'))) then
|
||||
{$elseif defined(netware)}
|
||||
if (Pos (DriveSeparator, S) <> 0) or
|
||||
((Length (S) > 0) and (S [1] in AllowDirectorySeparators)) then
|
||||
result:=true;
|
||||
{$elseif defined(win32) or defined(win64) or defined(go32v2) or defined(os2) or defined(watcom)}
|
||||
if ((length(s)>0) and (s[1] in AllowDirectorySeparators)) or
|
||||
(* The following check for non-empty AllowDriveSeparators assumes that all
|
||||
other platforms supporting drives and not handled as exceptions above
|
||||
should work with DOS-like paths, i.e. use absolute paths with one letter
|
||||
for drive followed by path separator *)
|
||||
((length(s)>2) and (s[2] in AllowDriveSeparators) and (s[3] in AllowDirectorySeparators)) then
|
||||
result:=true;
|
||||
{$else}
|
||||
if ((length(s)>0) and (s[1] in AllowDirectorySeparators)) or
|
||||
(* The following check for non-empty AllowDriveSeparators assumes that all
|
||||
other platforms supporting drives and not handled as exceptions above
|
||||
should work with DOS-like paths, i.e. use absolute paths with one letter
|
||||
for drive followed by path separator *)
|
||||
((AllowDriveSeparators <> []) and (length(s)>2) and (s[2] in AllowDriveSeparators) and (s[3] in AllowDirectorySeparators)) then
|
||||
result:=true;
|
||||
{$endif unix}
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user