Przeglądaj źródła

# revisions: 44312,44313

git-svn-id: branches/fixes_3_2@45705 -
marco 5 lat temu
rodzic
commit
a0f699ac3e
2 zmienionych plików z 13 dodań i 7 usunięć
  1. 1 1
      rtl/objpas/sysutils/finah.inc
  2. 12 6
      rtl/objpas/sysutils/syshelp.inc

+ 1 - 1
rtl/objpas/sysutils/finah.inc

@@ -29,7 +29,7 @@ function ExtractShortPathName(Const FileName : PathStr) : PathStr;
 function ExpandFileName (Const FileName : PathStr): PathStr;
 function ExpandFileNameCase (const FileName: PathStr; out MatchFound: TFilenameCaseMatch): PathStr;
 function ExpandUNCFileName (Const FileName : PathStr): PathStr;
-function ExtractRelativePath (Const BaseName,DestNAme : PathStr): PathStr;
+function ExtractRelativePath (Const BaseName,DestName : PathStr): PathStr;
 function IncludeTrailingPathDelimiter(Const Path : PathStr) : PathStr;
 function IncludeTrailingBackslash(Const Path : PathStr) : PathStr;
 function ExcludeTrailingBackslash(Const Path: PathStr): PathStr;

+ 12 - 6
rtl/objpas/sysutils/syshelp.inc

@@ -1225,9 +1225,12 @@ begin
     begin
     T:=SubString(LastSep);
 //    Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
-    MaybeGrow(Len);
-    Result[Len]:=T;
-    Inc(Len);
+    If (T<>'') or (not (TStringSplitOptions.ExcludeEmpty=Options)) then
+      begin
+      MaybeGrow(Len);
+      Result[Len]:=T;
+      Inc(Len);
+      end;
     end;
   SetLength(Result,Len);
 end;
@@ -1308,9 +1311,12 @@ begin
     begin
     T:=SubString(LastSep);
 //    Writeln('Examining >',T,'< at pos,',LastSep,' till pos ',Sep);
-    MaybeGrow(Len);
-    Result[Len]:=T;
-    Inc(Len);
+    If (T<>'') or (not (TStringSplitOptions.ExcludeEmpty=Options)) then
+      begin
+      MaybeGrow(Len);
+      Result[Len]:=T;
+      Inc(Len);
+      end;
     end;
   SetLength(Result,Len);
 end;