mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Update NSRegularExpression.m to fix reversed flag
The Cocoa callback block takes a pointer to a "stop" flag, but the ICU callback expects a return value with the opposite meaning (keepGoing). This error caused any longer-running regex to abort when it ran long enough to generate a callback instead of continuing as it should.
This commit is contained in:
parent
2de7793dbc
commit
f1ad19691e
1 changed files with 5 additions and 2 deletions
|
@ -371,17 +371,20 @@ static UBool
|
|||
callback(const void *context, int32_t steps)
|
||||
{
|
||||
BOOL stop = NO;
|
||||
BOOL keepGoing = YES;
|
||||
GSRegexBlock block = (GSRegexBlock)context;
|
||||
|
||||
if (NULL == context)
|
||||
{
|
||||
return FALSE;
|
||||
return TRUE; // keep going if there is no callback block
|
||||
}
|
||||
CALL_BLOCK(block, nil, NSMatchingProgress, &stop);
|
||||
return stop;
|
||||
keepGoing = !stop; // keep going if callback block didn't request a stop
|
||||
return keepGoing;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define DEFAULT_WORK_LIMIT 1500
|
||||
/**
|
||||
* The work limit specifies the number of iterations the matcher will do before
|
||||
|
|
Loading…
Reference in a new issue