Handle multi-line responses by ignoring all but last line.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13905 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-06-17 16:07:06 +00:00
parent 5530b2dd9f
commit 11c1a7d67d

View file

@ -588,9 +588,26 @@ static NSLock *urlLock = nil;
if (e == nil)
{
NSEnumerator *enumerator;
text = [info objectForKey: GSTelnetTextKey];
line = [text objectAtIndex: 0];
// NSLog(@"Ctl: %@", text);
/*
* Find first reply line which is not a continuation of another.
*/
enumerator = [text objectEnumerator];
while ((line = [enumerator nextObject]) != nil)
{
if ([line length] > 4 && [line characterAtIndex: 3] != '-')
{
break;
}
}
if (line == nil)
{
return;
}
if (state == cConnect)
{
if ([line hasPrefix: @"2"] == YES)