From 15929648712afe9edfb3333e8dfe8fab88aa448d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Go=C5=82aszewski?= Date: Fri, 2 Sep 2011 11:18:13 +0000 Subject: [PATCH] - rel.4: git_fixes added in place of git_ed5f55e967152ff6c730. Additionally fix memleak on image reload from http. Changed files: feh-git_ed5f55e967152ff6c730.patch -> 1.2 feh-git_fixes.patch -> 1.3 feh.spec -> 1.67 --- feh-git_ed5f55e967152ff6c730.patch | 42 -------------------- feh-git_fixes.patch | 64 ++++++++++++++++++++++++++++++ feh.spec | 6 +-- 3 files changed, 67 insertions(+), 45 deletions(-) delete mode 100644 feh-git_ed5f55e967152ff6c730.patch create mode 100644 feh-git_fixes.patch diff --git a/feh-git_ed5f55e967152ff6c730.patch b/feh-git_ed5f55e967152ff6c730.patch deleted file mode 100644 index 7a9e1fc..0000000 --- a/feh-git_ed5f55e967152ff6c730.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ./src/slideshow.c.1 2011-09-01 12:18:59.303918828 +0200 -+++ ./src/slideshow.c 2011-08-16 22:53:06.000000000 +0200 -@@ -149,7 +149,6 @@ void feh_reload_image(winwidget w, int r - - if (!w->file) { - im_weprintf(w, "couldn't reload, this image has no file associated with it."); -- winwidget_render_image(w, 0, 0); - return; - } - -@@ -167,17 +166,20 @@ void feh_reload_image(winwidget w, int r - old_w = gib_imlib_image_get_width(w->im); - old_h = gib_imlib_image_get_height(w->im); - -+ /* force imlib2 not to cache */ -+ winwidget_free_image(w); -+ - /* if the image has changed in dimensions - we gotta resize */ - if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) { - if (force_new) { - eprintf("failed to reload image\n"); - } else { - im_weprintf(w, "Couldn't reload image. Is it still there?"); -- winwidget_render_image(w, 0, 0); - } - winwidget_rename(w, title); - free(title); - free(new_title); -+ filelist = feh_file_remove_from_list(filelist, w->file); - return; - } - -@@ -185,9 +187,6 @@ void feh_reload_image(winwidget w, int r - (old_h != gib_imlib_image_get_height(tmp)))) - resize = 1; - -- /* force imlib2 not to cache */ -- winwidget_free_image(w); -- - w->im = tmp; - winwidget_reset_image(w); - diff --git a/feh-git_fixes.patch b/feh-git_fixes.patch new file mode 100644 index 0000000..8b9d87a --- /dev/null +++ b/feh-git_fixes.patch @@ -0,0 +1,64 @@ +--- ./src/slideshow.c.org 2011-09-02 12:55:22.245365638 +0200 ++++ ./src/slideshow.c 2011-09-02 12:55:29.089016324 +0200 +@@ -96,6 +96,11 @@ void cb_reload_timer(void *data) + + /* save the current filename for refinding it in new list */ + current_filename = estrdup(FEH_FILE(current_file->data)->filename); ++ ++ for (l = filelist; l; l = l->next) { ++ feh_file_free(l->data); ++ l->data = NULL; ++ } + gib_list_free_and_data(filelist); + filelist = NULL; + filelist_len = 0; +@@ -109,8 +114,7 @@ void cb_reload_timer(void *data) + add_file_to_filelist_recursively(".", FILELIST_FIRST); + + if (!(filelist_len = gib_list_length(filelist))) { +- fprintf(stderr, "No files found to reload.\n"); +- exit(1); ++ eprintf("No files found to reload."); + } + + /* find the previously current file */ +@@ -149,6 +153,7 @@ void feh_reload_image(winwidget w, int r + + if (!w->file) { + im_weprintf(w, "couldn't reload, this image has no file associated with it."); ++ winwidget_render_image(w, 0, 0); + return; + } + +@@ -166,20 +171,17 @@ void feh_reload_image(winwidget w, int r + old_w = gib_imlib_image_get_width(w->im); + old_h = gib_imlib_image_get_height(w->im); + +- /* force imlib2 not to cache */ +- winwidget_free_image(w); +- + /* if the image has changed in dimensions - we gotta resize */ + if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) { + if (force_new) { + eprintf("failed to reload image\n"); + } else { + im_weprintf(w, "Couldn't reload image. Is it still there?"); ++ winwidget_render_image(w, 0, 0); + } + winwidget_rename(w, title); + free(title); + free(new_title); +- filelist = feh_file_remove_from_list(filelist, w->file); + return; + } + +@@ -187,6 +189,9 @@ void feh_reload_image(winwidget w, int r + (old_h != gib_imlib_image_get_height(tmp)))) + resize = 1; + ++ /* force imlib2 not to cache */ ++ winwidget_free_image(w); ++ + w->im = tmp; + winwidget_reset_image(w); + diff --git a/feh.spec b/feh.spec index 9d3297e..6c3e2d2 100644 --- a/feh.spec +++ b/feh.spec @@ -3,14 +3,14 @@ Summary(hu.UTF-8): Gyors képnézegető/indexelő/montázsoló Summary(pl.UTF-8): Szybki program do przeglądania/indeksowania/montowania obrazów Name: feh Version: 1.15.1 -Release: 3 +Release: 4 License: BSD Group: X11/Applications/Graphics Source0: https://derf.homelinux.org/~derf/projects/feh/%{name}-%{version}.tar.bz2 # Source0-md5: 0684ff2dad34ee328ab2b6b717281787 URL: http://feh.finalrewind.org/ Patch0: %{name}-install.patch -Patch1: %{name}-git_ed5f55e967152ff6c730.patch +Patch1: %{name}-git_fixes.patch Source1: %{name}-bash-completion BuildRequires: giblib-devel >= 1.2.4 BuildRequires: imlib2-devel >= 1.0.0 @@ -66,7 +66,7 @@ bashowe dopełnianie linii poleceń programu feh. %prep %setup -q %patch0 -p1 -%patch1 -p1 -R +%patch1 -p1 %{__sed} -i "s,CFLAGS ?=.*,CFLAGS = %{rpmcflags}," config.mk %build -- 2.43.0