From http://www.jwz.org/xscreensaver/xscreensaver-5.23.tar.gz
[xscreensaver] / OSX / PrefsReader.m
index 5ed844d03f137eba9c90665c8aac90b3a411b23c..4f42fa90e9f3b8d289d73aec242d692597d61c40 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2006-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
     // make sure there's no resource mentioned in options and not defaults.
     if (![defsdict objectForKey:nsresource]) {
       if (! (!strcmp(resource, "font")        ||    // don't warn about these
+             !strcmp(resource, "foreground")  ||
              !strcmp(resource, "textLiteral") ||
              !strcmp(resource, "textFile")    ||
              !strcmp(resource, "textURL")     ||
 #if 0
   // Dump the entire resource database.
   NSDictionary *d = [userDefaults dictionaryRepresentation];
-  for (NSObject *key in d) {
+  for (NSObject *key in [[d allKeys]
+                          sortedArrayUsingSelector:@selector(compare:)]) {
     NSObject *val = [d objectForKey:key];
     NSLog (@"%@ = %@", key, val);
   }
     else if (n == 1) return YES;
     else goto FAIL;
   } else if ([o isKindOfClass:[NSString class]]) {
-    NSString *s = (NSString *) o;
+    NSString *s = [((NSString *) o) lowercaseString];
     if ([s isEqualToString:@"true"] ||
         [s isEqualToString:@"yes"] ||
         [s isEqualToString:@"1"])
   NSRange r = [name rangeOfString:@"." options:NSBackwardsSearch];
   if (r.length)
     name = [name substringFromIndex:r.location+1];
+  name = [name stringByReplacingOccurrencesOfString:@" " withString:@""];
   saver_name = [name retain];
 
   [self registerXrmKeys:opts defaults:defs];