Tidied a little

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13908 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-06-17 17:02:49 +00:00
parent ce2e901742
commit 5d552e4ad0

View file

@ -752,7 +752,39 @@ static NSLock *urlLock = nil;
}
else if (state == list)
{
if ([line hasPrefix: @"1"] == NO && [line hasPrefix: @"2"] == NO)
if ([line hasPrefix: @"550"] == YES)
{
NSRange r = [line rangeOfString: @"not a plain file"];
/*
* Some servers may return an error on listing even though
* the path was a valid directory. We try to catch some of
* those cases and produce an empty listing instead.
*/
if (r.location > 0)
{
NSNotificationCenter *nc;
nc = [NSNotificationCenter defaultCenter];
if (dHandle != nil)
{
[nc removeObserver: self name: nil object: dHandle];
[dHandle closeFile];
DESTROY(dHandle);
}
[nc removeObserver: self
name: GSTelnetNotification
object: cHandle];
DESTROY(cHandle);
state = idle;
[self didLoadBytes: [NSData data] loadComplete: YES];
}
else
{
e = line;
}
}
else if ([line hasPrefix: @"1"] == NO && [line hasPrefix: @"2"] == NO)
{
e = line;
}