|
From: | Sergey Golovin |
Subject: | [bug #39078] The method -[NSScanner scanUpToString:intoString] can't find a pattern at the very start of a string |
Date: | Mon, 27 May 2013 10:33:34 +0000 |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:21.0) Gecko/20100101 Firefox/21.0 |
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/
[Prev in Thread] | Current Thread | [Next in Thread] |