瀏覽代碼

* more generic fix for DriveSeparator = DirectorySeparator

Tomas Hajny 20 年之前
父節點
當前提交
64a9b00709
共有 1 個文件被更改,包括 10 次插入6 次删除
  1. 10 6
      rtl/inc/dos.inc

+ 10 - 6
rtl/inc/dos.inc

@@ -254,12 +254,13 @@ begin
 
 { Find the first DirectorySeparator or DriveSeparator from the end. }
   DirEnd := Length (Path);
-  while (DirEnd > 0) and not (Path [DirEnd] in
-{$IFNDEF MACOS}
+{ Avoid problems with platforms having DriveSeparator = DirectorySeparator. }
+  if DirectorySeparator = DriveSeparator then
+   while (DirEnd > 0) and not (Path [DirEnd] in [DirectorySeparator]) do
+    Dec (DirEnd)
+  else
+   while (DirEnd > 0) and not (Path [DirEnd] in
                                        [DirectorySeparator, DriveSeparator]) do
-{$ELSE}
-                                       [DirectorySeparator]) do
-{$ENDIF}
     Dec (DirEnd);
 
 { The first "extension" should be returned if LFN }
@@ -302,7 +303,10 @@ end;
 
 {
   $Log$
-  Revision 1.4  2004-12-28 21:50:14  olle
+  Revision 1.5  2004-12-29 19:10:47  hajny
+    * more generic fix for DriveSeparator = DirectorySeparator
+
+  Revision 1.4  2004/12/28 21:50:14  olle
     * hack to make macos compile
 
   Revision 1.3  2004/12/15 17:03:01  peter