mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-19 03:51:38 +00:00
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:
parent
2f0e787744
commit
b71c9584ba
1 changed files with 18 additions and 1 deletions
|
@ -588,9 +588,26 @@ static NSLock *urlLock = nil;
|
||||||
|
|
||||||
if (e == nil)
|
if (e == nil)
|
||||||
{
|
{
|
||||||
|
NSEnumerator *enumerator;
|
||||||
|
|
||||||
text = [info objectForKey: GSTelnetTextKey];
|
text = [info objectForKey: GSTelnetTextKey];
|
||||||
line = [text objectAtIndex: 0];
|
|
||||||
// NSLog(@"Ctl: %@", text);
|
// 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 (state == cConnect)
|
||||||
{
|
{
|
||||||
if ([line hasPrefix: @"2"] == YES)
|
if ([line hasPrefix: @"2"] == YES)
|
||||||
|
|
Loading…
Reference in a new issue