mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
9cc306b2e1
commit
292d546cd9
1 changed files with 23 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue