mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
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:
parent
ce2e901742
commit
5d552e4ad0
1 changed files with 33 additions and 1 deletions
|
@ -752,7 +752,39 @@ static NSLock *urlLock = nil;
|
||||||
}
|
}
|
||||||
else if (state == list)
|
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;
|
e = line;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue