View Issue Details

IDProjectCategoryView StatusLast Update
0002790SOGoBackend Generalpublic2014-05-23 15:13
Reporterbuzzdee Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSOpenBSDOS Version5.5
Product Version2.2.3 
Fixed in Version2.2.4 
Summary0002790: PATCH: return nil instead of NO where pointers are expected in sope-core/NGExtensions/NGCustomFileManager.m
Description

see attached patch to -git checkout of sope

TagsNo tags attached.

Activities

buzzdee

buzzdee

2014-05-23 09:16

reporter  

patch-sope-core_NGExtensions_NGCustomFileManager_m (2,429 bytes)   
$OpenBSD$

return nil when a pointer is expected instead of returning NO

--- sope-core/NGExtensions/NGCustomFileManager.m.orig	Fri May 23 11:04:46 2014
+++ sope-core/NGExtensions/NGCustomFileManager.m	Fri May 23 11:07:09 2014
@@ -91,10 +91,10 @@ typedef struct {
   NGCustomFMPath p;
   id (*op)(id,SEL,NSString *);
   
-  if (_sel == NULL) return NO;
+  if (_sel == NULL) return nil;
   p = [self _resolvePath:_path];
-  if ((_path = p.path) == nil) return NO;
-  if ((op = (void *)[p.fileManager methodForSelector:_sel]) == NULL) return NO;
+  if ((_path = p.path) == nil) return nil;
+  if ((op = (void *)[p.fileManager methodForSelector:_sel]) == NULL) return nil;
   
   return op(p.fileManager, _sel, _path);
 }
@@ -248,7 +248,7 @@ typedef struct {
 - (NSDictionary *)fileAttributesAtPath:(NSString *)_p traverseLink:(BOOL)_flag{
   NGCustomFMPath p;
   p = [self _resolvePath:_p];
-  if (p.path == nil) return NO;
+  if (p.path == nil) return nil;
   
   /* special link handling required ??? */
   return [p.fileManager fileAttributesAtPath:p.path traverseLink:_flag];
@@ -332,14 +332,14 @@ typedef struct {
 
 - (EOGlobalID *)globalIDForPath:(NSString *)_path {
   NGCustomFileManagerInfo *info;
-  if ((_path = [self makeAbsolutePath:_path])      == nil) return NO;
-  if ((info = [self fileManagerInfoForPath:_path]) == nil) return NO;
+  if ((_path = [self makeAbsolutePath:_path])      == nil) return nil;
+  if ((info = [self fileManagerInfoForPath:_path]) == nil) return nil;
 
   if (![info supportsGlobalIDs])
     return nil;
   
   if ((_path = [info rewriteAbsolutePath:_path]) == nil)
-    return NO;
+    return nil;
   
   return [[info fileManager] globalIDForPath:_path];
 }
@@ -354,7 +354,7 @@ typedef struct {
   return [self _boolDo:_cmd onPath:_path];
 }
 - (NSString *)trashFolderForPath:(NSString *)_path {
-  return NO;
+  return nil;
 }
 
 @end /* NGCustomFileManager */
@@ -395,7 +395,7 @@ typedef struct {
 - (NSData *)contentsAtPath:(NSString *)_path version:(NSString *)_version {
   NGCustomFMPath p;
   p = [self _resolvePath:_path];
-  if (p.path == nil) return NO;
+  if (p.path == nil) return nil;
   
   return [p.fileManager contentsAtPath:p.path version:_version];
 }
@@ -406,7 +406,7 @@ typedef struct {
 {
   NGCustomFMPath p;
   p = [self _resolvePath:_path];
-  if (p.path == nil) return NO;
+  if (p.path == nil) return nil;
   
   /* do something special to symlink ??? */
   
francis

francis

2014-05-23 15:13

administrator   ~0007096

Fixed.

See https://github.com/inverse-inc/sope/commit/a435b7f2b6a7dc2603663d64e574bc2d1e715047

Issue History

Date Modified Username Field Change
2014-05-23 09:16 buzzdee New Issue
2014-05-23 09:16 buzzdee File Added: patch-sope-core_NGExtensions_NGCustomFileManager_m
2014-05-23 15:13 francis Note Added: 0007096
2014-05-23 15:13 francis Status new => resolved
2014-05-23 15:13 francis Fixed in Version => 2.2.4
2014-05-23 15:13 francis Resolution open => fixed
2014-05-23 15:13 francis Assigned To => francis