X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=OSX%2FPrefsReader.m;h=dcbd34984fe79203692f363d382c0b1502c62172;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hp=e3be145696d796f25f9c84fb0f42bdc84646f315;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/OSX/PrefsReader.m b/OSX/PrefsReader.m index e3be1456..dcbd3498 100644 --- a/OSX/PrefsReader.m +++ b/OSX/PrefsReader.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2010 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -117,11 +117,11 @@ opts++; } +#if 0 // make sure there's no resource mentioned in defaults and not options. NSEnumerator *enumerator = [defsdict keyEnumerator]; NSString *key; while ((key = [enumerator nextObject])) { -#if 0 if (! [optsdict objectForKey:key]) if (! ([key isEqualToString:@"foreground"] || // don't warn about these [key isEqualToString:@"background"] || @@ -142,8 +142,8 @@ [key isEqualToString:@"TVTint"] )) NSLog (@"warning: \"%@\" is in defaults but not options", key); -#endif /* 0 */ } +#endif /* 0 */ } @@ -210,6 +210,15 @@ strcpy (result, result+1); } + // Kludge: assume that any string that begins with "~" and has a "/" + // anywhere in it should be expanded as if it is a pathname. + if (result[0] == '~' && strchr (result, '/')) { + os = [NSString stringWithCString:result encoding:NSUTF8StringEncoding]; + free (result); + result = strdup ([[os stringByExpandingTildeInPath] + cStringUsingEncoding:NSUTF8StringEncoding]); + } + return result; }