URL:
<http://savannah.gnu.org/bugs/?39078>
Summary: The method -[NSScanner scanUpToString:intoString]
can't find a pattern at the very start of a string
Project: GNUstep
Submitted by: svg
Submitted on: Пнд 27 Май 2013 14:33:33
Category: Base/Foundation
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Consider the following code:
------------------------------------------------------------
NSString *str = @"/** comment */";
NSScanner *scan;
NSString *comment = nil;
scan = [NSScanner scannerWithString: str];
if([scan scanUpToString: @"/**" intoString: &comment] &&
[comment isEqualToString: @""])
{
NSLog(@"OK");
}
else
{
NSLog(@"FAIL");
}
------------------------------------------------------------
Here the pattern @"/**" at the start of the 'str' is never found
by the 'scan'.
I'm guessing (from a practical point of view because i have no
access to OS X) it should return YES and populate 'comment' by
an empty string.
In the case i'm right the test is attached.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Пнд 27 Май 2013 14:33:33 Name: test02.m Size: 705B By: svg
<http://savannah.gnu.org/bugs/download.php?file_id=28186>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39078>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gnustep