summaryrefslogtreecommitdiff
path: root/rtl/os2/sysdir.inc
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/os2/sysdir.inc')
-rw-r--r--rtl/os2/sysdir.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/rtl/os2/sysdir.inc b/rtl/os2/sysdir.inc
index 1476f17083..f8912ca734 100644
--- a/rtl/os2/sysdir.inc
+++ b/rtl/os2/sysdir.inc
@@ -69,6 +69,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
@@ -78,6 +80,8 @@ begin
end;
end 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