mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
improve error checking
This commit is contained in:
parent
c0d6599def
commit
033b921903
2 changed files with 11 additions and 2 deletions
|
@ -2404,7 +2404,11 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
format: @"Invalid double quoted literal at %u", location];
|
||||
}
|
||||
[self setCharactersToBeSkipped: skip];
|
||||
[self scanString: @"\"" intoString: NULL];
|
||||
if (NO == [self scanString: @"\"" intoString: NULL])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Unterminated double quoted literal at %u", location];
|
||||
}
|
||||
return [NSExpression expressionForConstantValue: str];
|
||||
}
|
||||
|
||||
|
@ -2421,7 +2425,11 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
format: @"Invalid single quoted literal at %u", location];
|
||||
}
|
||||
[self setCharactersToBeSkipped: skip];
|
||||
[self scanString: @"'" intoString: NULL];
|
||||
if (NO == [self scanString: @"'" intoString: NULL])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Unterminated single quoted literal at %u", location];
|
||||
}
|
||||
return [NSExpression expressionForConstantValue: str];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue