diff options
author | Simon Rettberg | 2019-07-30 16:03:58 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-30 16:03:58 +0200 |
commit | 6a32252403781b303d4ebd195932ce39c5b1c08e (patch) | |
tree | cd2f8b3c4052c1b575caf33c9983ae531fad9092 /hacks/glitchpeg.c | |
parent | Remove android and OSX files (diff) | |
download | xscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.tar.gz xscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.tar.xz xscreensaver-6a32252403781b303d4ebd195932ce39c5b1c08e.zip |
Update to 5.43
Diffstat (limited to 'hacks/glitchpeg.c')
-rw-r--r-- | hacks/glitchpeg.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/hacks/glitchpeg.c b/hacks/glitchpeg.c index 4f3b052..91a05de 100644 --- a/hacks/glitchpeg.c +++ b/hacks/glitchpeg.c @@ -1,4 +1,4 @@ -/* glitchpeg, Copyright (c) 2018 Jamie Zawinski <jwz@jwz.org> +/* glitchpeg, Copyright (c) 2018-2019 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 @@ -232,6 +232,13 @@ xscreensaver_getimage_file_cb (XtPointer closure, int *source, XtInputId *id) while (L > 0 && (buf[L-1] == '\r' || buf[L-1] == '\n')) buf[--L] = 0; + if (!*file) + { + fprintf (stderr, "%s: no suitable images in imageDirectory\n", + progname); + return; + } + fp = fopen (file, "r"); if (! fp) { @@ -286,6 +293,14 @@ glitchpeg_init (Display *dpy, Window window) XClearWindow (st->dpy, st->window); +# if 0 /* This check doesn't work, because X11 resources are the devil. */ + if (! get_boolean_resource (dpy, "chooseRandomImages", "Boolean")) + { + fprintf (stderr, "%s: chooseRandomImages must be True", progname); + exit (1); + } +# endif + return st; } |