|
@@ -112,6 +112,8 @@ begin
|
|
|
if Len > 2 then
|
|
|
begin
|
|
|
DoDirSeparators (S);
|
|
|
+ if (S [Pred (Len)] = DirectorySeparator) and (Len <> 3) then
|
|
|
+ S [Pred (Len)] := #0;
|
|
|
RC := DosSetCurrentDir (S);
|
|
|
if RC <> 0 then
|
|
|
begin
|
|
@@ -123,6 +125,8 @@ begin
|
|
|
else
|
|
|
begin
|
|
|
DoDirSeparators (S);
|
|
|
+ if (Len > 1) and (S [Pred (Len)] = DirectorySeparator) then
|
|
|
+ S [Pred (Len)] := #0;
|
|
|
RC := DosSetCurrentDir (S);
|
|
|
if RC <> 0 then
|
|
|
begin
|
|
@@ -150,14 +154,22 @@ begin
|
|
|
@LCHDIR:
|
|
|
end ['eax','edx','esi'];
|
|
|
if (Len > 2) and (InOutRes <> 0) then
|
|
|
+ begin
|
|
|
+ if (S [Pred (Len)] in AllowDirectorySeparators) and (Len <> 3) then
|
|
|
+ S [Pred (Len)] := #0;
|
|
|
{ Under EMX 0.9d DOS this routine may sometime }
|
|
|
{ fail or crash the system. }
|
|
|
- DosDir ($3B, S);
|
|
|
+ DosDir ($3B, S);
|
|
|
+ end;
|
|
|
end
|
|
|
else
|
|
|
+ begin
|
|
|
+ if (Len > 1) and (S [Pred (Len)] in AllowDirectorySeparators) then
|
|
|
+ S [Pred (Len)] := #0;
|
|
|
{ Under EMX 0.9d DOS this routine may sometime }
|
|
|
{ fail or crash the system. }
|
|
|
- DosDir ($3B, S);
|
|
|
+ DosDir ($3B, S);
|
|
|
+ end;
|
|
|
end;
|
|
|
|
|
|
|