Browse Source

* Fix bug #36806, do not add empty last sep, patch from Delfion

git-svn-id: trunk@44312 -
michael 5 years ago
parent
commit
123fe94206
1 changed files with 6 additions and 3 deletions
  1. 6 3
      rtl/objpas/sysutils/syshelp.inc

+ 6 - 3
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;