bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #33464] NSString -getLineStart:end:contentsEnd:forRange: returns in


From: Wolfgang Lux
Subject: [bug #33464] NSString -getLineStart:end:contentsEnd:forRange: returns incorrect results
Date: Thu, 02 Jun 2011 18:10:12 +0000
User-agent: Mozilla/5.0 (X11; U; Linux ppc; de; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17

URL:
  <http://savannah.gnu.org/bugs/?33464>

                 Summary: NSString -getLineStart:end:contentsEnd:forRange:
returns incorrect results 
                 Project: GNUstep
            Submitted by: wlux
            Submitted on: Do 02 Jun 2011 18:10:11 GMT
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This happens (only) for strings with DOS-style line ending (\r\n).
For instance, the attached test program yields the following output for the
string 'abc\r\ndef\r\n'.
0 -> start=0 end=2/5
1 -> start=0 end=2/5
2 -> start=0 end=2/5
3 -> start=0 end=2/5
4 -> start=4 end=4/5
5 -> start=5 end=7/10
6 -> start=5 end=7/10
7 -> start=5 end=7/10
8 -> start=5 end=7/10
9 -> start=9 end=9/10
The expected output (generated on OS X) is
0 -> start=0 end=3/5
1 -> start=0 end=3/5
2 -> start=0 end=3/5
3 -> start=0 end=3/5
4 -> start=0 end=3/5
5 -> start=5 end=8/10
6 -> start=5 end=8/10
7 -> start=5 end=8/10
8 -> start=5 end=8/10
9 -> start=5 end=8/10
Note that contents end is 2/7 rather than 3/8 for the first four characters of
each line and 4/9 instead of 3/8 for the last character.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Do 02 Jun 2011 18:10:11 GMT  Name: test.m  Size: 499B   By: wlux

<http://savannah.gnu.org/bugs/download.php?file_id=23497>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33464>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]