}
while (opts_array[0].option) {
- if (!strcmp (opts_array[0].option, buf)) {
+ const char *s1 = opts_array[0].option;
+ const char *s2 = buf;
+ if (s1[0] == '-' && s1[1] == '-') s1++; /* -x and --x are the same */
+ if (s2[0] == '-' && s2[1] == '-') s2++;
+ if (!strcmp (s1, s2)) {
const char *ret = 0;
if (opts_array[0].argKind == XrmoptionNoArg) {
random_image_p = get_boolean_resource(dpy, "chooseRandomImages", "Boolean");
image_directory = get_string_resource (dpy, "imageDirectory", "String");
+ if (!strncmp (image_directory, "~/", 2))
+ {
+ const char *home = getenv("HOME");
+ if (home && *home)
+ {
+ char *s2 = (char *)
+ malloc (strlen(image_directory) + strlen(home) + 10);
+ strcpy (s2, home);
+ strcat (s2, image_directory + 1);
+ free (image_directory);
+ image_directory = s2;
+ }
+ }
+
progname = argv[0] = oprogname;
for (i = 1; i < argc; i++)
# ifndef HAVE_IPHONE
if (filep)
+ /* On macOS, get_string_resource() already expanded "~/". */
dir = get_string_resource (dpy, "imageDirectory", "ImageDirectory");
if (!dir || !*dir)
static const char screensaver_id[] =
"@(#)xscreensaver 6.05 (09-Sep-2022), by Jamie Zawinski (jwz@jwz.org)";
#define XSCREENSAVER_VERSION "6.05"
-#define XSCREENSAVER_RELEASED 1662750000
+#define XSCREENSAVER_RELEASED 1662834403