Tidied some range stuff.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3581 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-01-20 18:26:46 +00:00
parent 205e47ed25
commit ff8b01532f

View file

@ -783,6 +783,7 @@ handle_printf_atsign (FILE *stream,
{
start = aRange.location; stop = NSMaxRange(aRange); step = 1;
}
range.location = 0;
range.length = 0;
for (i = start; i != stop; i+=step)
{
@ -2286,12 +2287,17 @@ else
NSString *substring = nil;
range = [self rangeOfString:@"." options:NSBackwardsSearch];
if (range.length == 0
|| range.location < ([self rangeOfCharacterFromSet: pathSeps()
options: NSBackwardsSearch]).location)
if (range.length == 0)
substring = nil;
else
substring = [self substringFromIndex:range.location + 1];
{
NSRange range2 = [self rangeOfCharacterFromSet: pathSeps()
options: NSBackwardsSearch];
if (range2.length > 0 && range.location < range2.location)
substring = nil;
else
substring = [self substringFromIndex:range.location + 1];
}
if (!substring)
substring = [[NSString new] autorelease];