mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix boundary issues
This commit is contained in:
parent
c6e4220409
commit
4233915c06
1 changed files with 12 additions and 4 deletions
|
@ -715,13 +715,15 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, NSUInteger mask, NSRange aRange)
|
|||
unichar myCharacter = GSEQ_SGETC(myIndex);
|
||||
unichar strCharacter = strFirstCharacter;
|
||||
|
||||
while (myIndex + i < rangeEnd)
|
||||
for (;;)
|
||||
{
|
||||
if ((myCharacter != strCharacter) &&
|
||||
((uni_tolower(myCharacter) != uni_tolower(strCharacter))))
|
||||
break;
|
||||
if (i == strLength)
|
||||
return (NSRange){myIndex, strLength};
|
||||
if (myIndex + i >= rangeEnd)
|
||||
break;
|
||||
myCharacter = GSEQ_SGETC(myIndex + i);
|
||||
strCharacter = GSEQ_OGETC(i);
|
||||
i++;
|
||||
|
@ -750,13 +752,15 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, NSUInteger mask, NSRange aRange)
|
|||
unichar myCharacter = GSEQ_SGETC(myIndex);
|
||||
unichar strCharacter = strFirstCharacter;
|
||||
|
||||
while (myIndex + i < rangeEnd)
|
||||
for (;;)
|
||||
{
|
||||
if ((myCharacter != strCharacter) &&
|
||||
((uni_tolower(myCharacter) != uni_tolower(strCharacter))))
|
||||
break;
|
||||
if (i == strLength)
|
||||
return (NSRange){myIndex, strLength};
|
||||
if (myIndex + i >= rangeEnd)
|
||||
break;
|
||||
myCharacter = GSEQ_SGETC(myIndex + i);
|
||||
strCharacter = GSEQ_OGETC(i);
|
||||
i++;
|
||||
|
@ -784,12 +788,14 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, NSUInteger mask, NSRange aRange)
|
|||
unichar myCharacter = GSEQ_SGETC(myIndex);
|
||||
unichar strCharacter = strFirstCharacter;
|
||||
|
||||
while (myIndex + i < rangeEnd)
|
||||
for (;;)
|
||||
{
|
||||
if (myCharacter != strCharacter)
|
||||
break;
|
||||
if (i == strLength)
|
||||
return (NSRange){myIndex, strLength};
|
||||
if (myIndex + i >= rangeEnd)
|
||||
break;
|
||||
myCharacter = GSEQ_SGETC(myIndex + i);
|
||||
strCharacter = GSEQ_OGETC(i);
|
||||
i++;
|
||||
|
@ -817,12 +823,14 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, NSUInteger mask, NSRange aRange)
|
|||
unichar myCharacter = GSEQ_SGETC(myIndex);
|
||||
unichar strCharacter = strFirstCharacter;
|
||||
|
||||
while (myIndex + i < rangeEnd)
|
||||
for (;;)
|
||||
{
|
||||
if (myCharacter != strCharacter)
|
||||
break;
|
||||
if (i == strLength)
|
||||
return (NSRange){myIndex, strLength};
|
||||
if (myIndex + i >= rangeEnd)
|
||||
break;
|
||||
myCharacter = GSEQ_SGETC(myIndex + i);
|
||||
strCharacter = GSEQ_OGETC(i);
|
||||
i++;
|
||||
|
|
Loading…
Reference in a new issue