NSString: Fix -commonPrefixWithString:options: behaviour (#455)

* Update changelog

* NSString: fix -commonPrefixWithString:options: behaviour

* NSString: More test cases
This commit is contained in:
Hugo Melder 2024-10-28 06:42:41 -07:00 committed by rfm
parent 01b719f2af
commit f940412e0e
4 changed files with 53 additions and 0 deletions

View file

@ -3227,6 +3227,11 @@ register_printf_atsign ()
- (NSString*) commonPrefixWithString: (NSString*)aString
options: (NSUInteger)mask
{
// Return empty string to match behaviour on macOS
if (nil == aString)
{
return @"";
}
if (mask & NSLiteralSearch)
{
int prefix_len = 0;