Parcourir la source

* fixed GetDirs in case the last character of the passed directory
= PathDelim (called like that from the compiler)

git-svn-id: trunk@9274 -

Jonas Maebe il y a 17 ans
Parent
commit
1445ca1198
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      rtl/objpas/sysutils/fina.inc

+ 3 - 1
rtl/objpas/sysutils/fina.inc

@@ -192,7 +192,9 @@ begin
   Result:=-1;
   While I<=Length(DirName) do
     begin
-    If DirName[i]=PathDelim then
+    If (DirName[i]=PathDelim) and
+       { avoid error in case last char=pathdelim }
+       (length(dirname)>i) then
       begin
       DirName[i]:=#0;
       Inc(Result);