From 0ef9ca5cc712f2cef23c57f52f362edeed2b3ace Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sat, 25 Apr 2009 12:36:31 +0000 Subject: [PATCH] * Source/NSFileManager.m: Partial reversion of previous patch. The calls in the method changeAttribues:atPath: to the GSAttrDictionary which is used there were erroneously changed to assume an NSNumber. This was causing a crash in various applications. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28246 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSFileManager.m | 11 ++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1dd097269..e7edd875d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-25 08:35-EDT Gregory John Casamento + + * Source/NSFileManager.m: Partial reversion of previous patch. + The calls in the method changeAttribues:atPath: to the GSAttrDictionary + which is used there were erroneously changed to assume an NSNumber. + This was causing a crash in various applications. + 2009-04-24 Fred Morcos * Headers/Foundation/NSFileManager.h: diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index 6f1421aff..085fd1869 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -388,7 +388,6 @@ static NSStringEncoding defaultEncoding; - (BOOL) changeFileAttributes: (NSDictionary*)attributes atPath: (NSString*)path { const _CHAR *lpath = 0; - NSNumber *tmpNum; unsigned long num; NSString *str; NSDate *date; @@ -401,8 +400,7 @@ static NSStringEncoding defaultEncoding; lpath = [defaultManager fileSystemRepresentationWithPath: path]; #ifndef __MINGW32__ - tmpNum = [attributes fileOwnerAccountID]; - num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound; + num = (unsigned long)[(id)attributes fileOwnerAccountID]; if (num != NSNotFound) { if (chown(lpath, num, -1) != 0) @@ -457,8 +455,7 @@ static NSStringEncoding defaultEncoding; } } - tmpNum = [attributes fileGroupOwnerAccountID]; - num = tmpNum ? [tmpNum unsignedLongValue] : NSNotFound; + num =(unsigned long)[(id)attributes fileGroupOwnerAccountID]; if (num != NSNotFound) { if (chown(lpath, -1, num) != 0) @@ -511,7 +508,7 @@ static NSStringEncoding defaultEncoding; } #endif /* __MINGW32__ */ - num = [attributes filePosixPermissions]; + num = [(id)attributes filePosixPermissions]; if (num != NSNotFound) { if (_CHMOD(lpath, num) != 0) @@ -524,7 +521,7 @@ static NSStringEncoding defaultEncoding; } } - date = [attributes fileModificationDate]; + date = [(id)attributes fileModificationDate]; if (date != nil) { BOOL ok = NO;