mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Tweaks to support UTF-8 literal string encoding supported by more recent
compilers. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33972 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3cc9fb2c50
commit
48fa5991ab
7 changed files with 408 additions and 231 deletions
|
@ -2052,25 +2052,26 @@ handle_printf_atsign (FILE *stream,
|
|||
[NSException raise: NSInvalidArgumentException format: @"range of nil"];
|
||||
if ((mask & NSRegularExpressionSearch) == NSRegularExpressionSearch)
|
||||
{
|
||||
NSRange r = {NSNotFound, 0};
|
||||
NSError *e = nil;
|
||||
NSUInteger options = 0;
|
||||
NSRegularExpression *regex = [NSRegularExpression alloc];
|
||||
if ((mask & NSCaseInsensitiveSearch) == NSCaseInsensitiveSearch)
|
||||
{
|
||||
options |= NSRegularExpressionCaseInsensitive;
|
||||
}
|
||||
regex = [regex initWithPattern: aString options: options error: &e];
|
||||
if (nil == e)
|
||||
{
|
||||
options = ((mask & NSAnchoredSearch) == NSAnchoredSearch) ?
|
||||
NSMatchingAnchored : 0;
|
||||
r = [regex rangeOfFirstMatchInString: self
|
||||
options: options
|
||||
range: aRange];
|
||||
}
|
||||
[regex release];
|
||||
return r;
|
||||
NSRange r = {NSNotFound, 0};
|
||||
NSError *e = nil;
|
||||
NSUInteger options = 0;
|
||||
NSRegularExpression *regex = [NSRegularExpression alloc];
|
||||
|
||||
if ((mask & NSCaseInsensitiveSearch) == NSCaseInsensitiveSearch)
|
||||
{
|
||||
options |= NSRegularExpressionCaseInsensitive;
|
||||
}
|
||||
regex = [regex initWithPattern: aString options: options error: &e];
|
||||
if (nil == e)
|
||||
{
|
||||
options = ((mask & NSAnchoredSearch) == NSAnchoredSearch)
|
||||
? NSMatchingAnchored : 0;
|
||||
r = [regex rangeOfFirstMatchInString: self
|
||||
options: options
|
||||
range: aRange];
|
||||
}
|
||||
[regex release];
|
||||
return r;
|
||||
}
|
||||
return strRangeNsNs(self, aString, mask, aRange);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue