소스 검색

* fix for 4419 + removed undocumented trimming.
Probably original programmer used space as separator and then
this works.

git-svn-id: trunk@2891 -

marco 19 년 전
부모
커밋
457d44c2c2
1개의 변경된 파일14개의 추가작업 그리고 2개의 파일을 삭제
  1. 14 2
      rtl/objpas/strutils.pp

+ 14 - 2
rtl/objpas/strutils.pp

@@ -951,9 +951,21 @@ end;
 
 function Copy2SymbDel(var S: string; Symb: Char): string;
 
+var
+  p: Integer;
+
 begin
-  Result:=Copy2Symb(S,Symb);
-  S:=TrimRight(Copy(S,Length(Result)+1,Length(S)));
+  p:=Pos(Symb,S);
+  if p=0 then
+    begin
+      result:=s;
+      s:='';
+    end
+  else
+    begin	
+      Result:=Copy(S,1,p-1);
+      delete(s,1,p);		
+    end;
 end;
 
 function Copy2Space(const S: string): string;inline;