From 6a32252403781b303d4ebd195932ce39c5b1c08e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Jul 2019 16:03:58 +0200 Subject: Update to 5.43 --- hacks/glitchpeg.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'hacks/glitchpeg.c') 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 +/* glitchpeg, Copyright (c) 2018-2019 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 @@ -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; } -- cgit v1.2.3-55-g7522