diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-18 20:19:49 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-18 20:19:49 +0100 |
commit | ddf90e154a33a4e15054d962124f381eb3608fa2 (patch) | |
tree | 42c38187539a50a2027e6482da53389f6d9720d1 /src/slideshow.c | |
parent | 310432883fb3712acd31af4570618454e9cdcd59 (diff) |
Make slideshow_save_image work again when opt.output_dir is unset
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index 19aeaee..145bee1 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -615,7 +615,10 @@ void slideshow_save_image(winwidget win) { char *tmpname; Imlib_Load_Error err; - char *base_dir = estrjoin("", opt.output_dir ? opt.output_dir : "", "/", NULL); + char *base_dir = ""; + if (opt.output_dir) { + base_dir = estrjoin("", opt.output_dir, "/", NULL); + } if (win->file) { tmpname = feh_unique_filename(base_dir, FEH_FILE(win->file->data)->name); @@ -628,7 +631,9 @@ void slideshow_save_image(winwidget win) tmpname = feh_unique_filename(base_dir, "noname.png"); } - free(base_dir); + if (opt.output_dir) { + free(base_dir); + } if (opt.verbose) fprintf(stderr, "saving image to filename '%s'\n", tmpname); |