$OpenBSD: patch-Source_NSUserDefaults_m,v 1.3 2012/07/08 13:22:54 sebastia Exp $

Introduce the GS_DEFAULTS_LOCKDIR to allow the gnustep ports to
build with systrace. Otherwise plmerge would try to create a lock
file in the users home directory.

Fix for 64Bit comparison of NSNotFound

--- Source/NSUserDefaults.m.orig	Sun Jan 29 12:10:05 2012
+++ Source/NSUserDefaults.m	Mon Apr  9 14:35:54 2012
@@ -1178,9 +1178,14 @@ newLanguages(NSArray *oldNames)
 - (id) initWithUser: (NSString*)userName
 {
   NSString	*path;
-
-  path = [GSDefaultsRootForUser(userName)
-    stringByAppendingPathComponent: defaultsFile];
+  if ([[[NSProcessInfo processInfo] environment] objectForKey:@"GS_DEFAULTS_LOCKDIR"])
+  {
+    path = [[[[NSProcessInfo processInfo] environment] objectForKey:@"GS_DEFAULTS_LOCKDIR"] stringByAppendingPathComponent: defaultsFile];
+  } else 
+  {
+    path = [GSDefaultsRootForUser(userName)
+      stringByAppendingPathComponent: defaultsFile];
+  }
   return [self initWithContentsOfFile: path];
 }
 
@@ -1222,7 +1227,7 @@ newLanguages(NSArray *oldNames)
 
 - (void) addSuiteNamed: (NSString*)aName
 {
-  unsigned	index;
+  NSUInteger	index;
 
   if (aName == nil)
     {
