On Tue, 8 Mar 2016, Rik van Kekem wrote:

Michael Van Canneyt wrote:

On FPC, it returns 1, on Delphi, it returns 2. And debuging the "splited"
variable, on FPC I get only and "x" value, Delphi "x" and "y".

Is this a bug?

Yes. Quite strange, because I have testcases for this ?

And content: string = 'x:yb'; does work correctly.

The problem is in this line (Line 1196 of syshelp.inc):
 if (LastSep<Length-1) and ((ACount=0) or (Len<ACount)) then

In this case LastSep is 2 and Length - 1 is also 2.
So the last y doesn't get into the array.

Indeed, this is the problem. Fixed in rev. 33209.
Added testcase to my testsuite.

Probably the zero-based nature of these methods got me confused :/

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to