mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Correct result of NSRegularExpression -rangeOfFirstMatchInString:...
When no match is found location must be set to NSNotFound. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b1cb675199
commit
9ed632dcdb
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-12-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSRegularExpression.m (-rangeOfFirstMatchInString:...):
|
||||
Return range (NSNotFound, 0) when no match is found.
|
||||
|
||||
2011-12-22 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSRegularExpression.m (-initWithPattern:options:error:,
|
||||
|
|
|
@ -491,7 +491,7 @@ prepareResult(NSRegularExpression *regex,
|
|||
options: (NSMatchingOptions)opts
|
||||
range: (NSRange)range
|
||||
{
|
||||
__block NSRange r;
|
||||
__block NSRange r = {NSNotFound, 0};
|
||||
|
||||
opts &= ~NSMatchingReportProgress;
|
||||
opts &= ~NSMatchingReportCompletion;
|
||||
|
@ -623,7 +623,7 @@ prepareResult(NSRegularExpression *regex,
|
|||
options: (NSMatchingOptions)opts
|
||||
range: (NSRange)range
|
||||
{
|
||||
NSRange result = {0,0};
|
||||
NSRange result = {NSNotFound, 0};
|
||||
|
||||
FAKE_BLOCK_HACK(result,
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue