X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=utils%2Fgrabclient.c;h=082f1f167a7e5a62dafda935e156b4a9da99e510;hp=58d506efd888ac9a3b7c7a06fdbd91aacad72ab5;hb=4ade52359b6eba3621566dac79793a33aa4c915f;hpb=ff35d056d723c9a5ffe728dbba5f1c25e141be04 diff --git a/utils/grabclient.c b/utils/grabclient.c index 58d506ef..082f1f16 100644 --- a/utils/grabclient.c +++ b/utils/grabclient.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2013 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 @@ -619,6 +619,19 @@ pipe_cb (XtPointer closure, int *source, XtInputId *id) geom.height = h; } + /* Take the extension off of the file name. */ + /* Duplicated in driver/xscreensaver-getimage.c. */ + if (buf && *buf) + { + char *slash = strrchr (buf, '/'); + char *dot = strrchr ((slash ? slash : buf), '.'); + if (dot) *dot = 0; + /* Replace slashes with newlines */ + /* while (dot = strchr(buf, '/')) *dot = '\n'; */ + /* Replace slashes with spaces */ + while ((dot = strchr(buf, '/'))) *dot = ' '; + } + if (absfile) free (absfile); clo2->callback (clo2->screen, clo2->xwindow, clo2->drawable, buf, &geom, clo2->closure); @@ -810,6 +823,7 @@ load_random_image_1 (Screen *screen, Window window, Drawable drawable, /* If we got here, we loaded synchronously even though they wanted async. */ callback (screen, window, drawable, name_ret_2, &geom_ret_2, closure); + if (name_ret_2) free (name_ret_2); } }