Optimisation accidentally omitted when changelog was updated.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28253 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-04-27 11:52:44 +00:00
parent 9cc306b2e1
commit 292d546cd9

View file

@ -238,6 +238,7 @@
*/
@interface GSAttrDictionary : NSDictionary
{
@public
struct _STATB statbuf;
_CHAR _path[0];
}
@ -245,6 +246,8 @@
traverseLink: (BOOL)traverse;
@end
static Class GSAttrDictionaryClass = 0;
/*
* We also need a special enumerator class to enumerate the dictionary.
*/
@ -342,6 +345,7 @@ static NSStringEncoding defaultEncoding;
+ (void) initialize
{
defaultEncoding = [NSString defaultCStringEncoding];
GSAttrDictionaryClass = [GSAttrDictionary class];
}
- (void) dealloc
@ -401,8 +405,15 @@ static NSStringEncoding defaultEncoding;
lpath = [defaultManager fileSystemRepresentationWithPath: path];
#ifndef __MINGW32__
tmpNum = [attributes fileOwnerAccountID];
num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound;
if (GSObjCClass(attributes) == GSAttrDictionaryClass)
{
num = ((GSAttrDictionary*)attributes)->statbuf.st_uid;
}
else
{
tmpNum = [attributes fileOwnerAccountID];
num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound;
}
if (num != NSNotFound)
{
if (chown(lpath, num, -1) != 0)
@ -457,8 +468,15 @@ static NSStringEncoding defaultEncoding;
}
}
tmpNum = [attributes fileGroupOwnerAccountID];
num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound;
if (GSObjCClass(attributes) == GSAttrDictionaryClass)
{
num = ((GSAttrDictionary*)attributes)->statbuf.st_gid;
}
else
{
tmpNum = [attributes fileGroupOwnerAccountID];
num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound;
}
if (num != NSNotFound)
{
if (chown(lpath, -1, num) != 0)
@ -1724,7 +1742,7 @@ static NSStringEncoding defaultEncoding;
{
NSDictionary *d;
d = [GSAttrDictionary attributesAt:
d = [GSAttrDictionaryClass attributesAt:
[self fileSystemRepresentationWithPath: path] traverseLink: flag];
return d;
}