Commit ddf90e15 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Make slideshow_save_image work again when opt.output_dir is unset

parent 31043288
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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");
	}

	if (opt.output_dir) {
		free(base_dir);
	}

	if (opt.verbose)
		fprintf(stderr, "saving image to filename '%s'\n", tmpname);
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ char path_is_url(char *path) {
	return 0;
}

/* Note: path must end with a trailing / or be an empty string */
/* free the result please */
char *feh_unique_filename(char *path, char *basename)
{