X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2FPrefsReader.m;h=507a557b09b5cbdc498d77f2c6b48f4a370ed923;hp=e3be145696d796f25f9c84fb0f42bdc84646f315;hb=f0261d8acab611f3433160e4f07367b870439739;hpb=7b34ef992563d7bcbb64cc5597dc45fa24470b05 diff --git a/OSX/PrefsReader.m b/OSX/PrefsReader.m index e3be1456..507a557b 100644 --- a/OSX/PrefsReader.m +++ b/OSX/PrefsReader.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2009 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 @@ -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; }