Update to zathura-0.3.2.

Also fix crashes in searching functionality.

sizeof(bool) < sizeof(gboolean) causing stack trashing when writing a
gboolean into a bool.

OK landry@
This commit is contained in:
edd 2014-11-30 23:14:48 +00:00
parent 85566819e3
commit 2fda2aa5a4
7 changed files with 124 additions and 23 deletions

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
# $OpenBSD: Makefile,v 1.2 2014/11/30 23:14:48 edd Exp $
V = 0.2.9
COMMENT = pdf viewer with vi-like keybindings
V = 0.3.2
COMMENT = PDF viewer with vi-like keybindings
DISTNAME = zathura-${V}
CATEGORIES = textproc x11
@ -23,7 +23,7 @@ BUILD_DEPENDS = textproc/py-docutils
RUN_DEPENDS = devel/desktop-file-utils
LIB_DEPENDS = graphics/gdk-pixbuf2 \
devel/libmagic \
x11/girara
x11/girara>=0.2.3
MAKE_FLAGS = MANPREFIX=${PREFIX}/man \
DESKTOPPREFIX=${PREFIX}/share/applications \

View File

@ -1,2 +1,2 @@
SHA256 (zathura-0.2.9.tar.gz) = LAcdQD7JNIuDlWeyiXhQvynZwkyFmCtVCaGkKacu4J8=
SIZE (zathura-0.2.9.tar.gz) = 196690
SHA256 (zathura-0.3.2.tar.gz) = /aZQPcWyH3xmcwF5j70sl4iX5otFVejHMZRc7NnRZeI=
SIZE (zathura-0.3.2.tar.gz) = 202943

View File

@ -1,7 +1,10 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
--- Makefile.orig Tue Jun 24 22:31:41 2014
+++ Makefile Tue Aug 26 23:20:25 2014
@@ -148,7 +148,7 @@ gdb: debug
$OpenBSD: patch-Makefile,v 1.2 2014/11/30 23:14:48 edd Exp $
Patch away hard-coded make.
--- Makefile.orig Sun Nov 9 22:50:01 2014
+++ Makefile Mon Nov 24 11:53:18 2014
@@ -219,7 +219,7 @@ gdb: debug
$(QUIET)cgdb ${PROJECT}-debug
test: ${OBJECTS}
@ -10,3 +13,12 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
dist: clean build-manpages
$(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \
@@ -228,7 +228,7 @@ dist: clean build-manpages
doc/_build/$(PROJECT).1 doc/_build/$(PROJECT)rc.5
doc:
- $(QUIET)make -C doc
+ $(QUIET)${MAKE} -C doc
po:
$(QUIET)${MAKE} -C po

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-tests_Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
--- tests/Makefile.orig Tue Jun 24 22:31:41 2014
+++ tests/Makefile Tue Aug 26 23:20:25 2014
@@ -47,7 +47,7 @@ options:
$(QUIET)${CC} -c -I.. ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
${PROJECT}: options ${OBJECTS}
- $(QUIET)make -C ..
+ $(QUIET)${MAKE} -C ..
$(ECHO) CC -o $@
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${ZOBJECTS} ${LIBS}

View File

@ -0,0 +1,77 @@
$OpenBSD: patch-zathura_page-widget_c,v 1.1 2014/11/30 23:14:48 edd Exp $
Fix incorrect use of booleans and glib that trash the stack.
https://git.pwmt.org/?p=zathura.git;a=commit;h=8d71a755d648c5856ef91d214bfdb46925f6c2f0
--- zathura/page-widget.c.orig Sun Nov 9 22:50:01 2014
+++ zathura/page-widget.c Sat Nov 29 18:40:34 2014
@@ -28,8 +28,8 @@ typedef struct zathura_page_widget_private_s {
struct {
girara_list_t* list; /**< List of links on the page */
- bool retrieved; /**< True if we already tried to retrieve the list of links */
- bool draw; /**< True if links should be drawn */
+ gboolean retrieved; /**< True if we already tried to retrieve the list of links */
+ gboolean draw; /**< True if links should be drawn */
unsigned int offset; /**< Offset to the links */
unsigned int n; /**< Number */
} links;
@@ -37,12 +37,12 @@ typedef struct zathura_page_widget_private_s {
struct {
girara_list_t* list; /**< A list if there are search results that should be drawn */
int current; /**< The index of the current search result */
- bool draw; /**< Draw search results */
+ gboolean draw; /**< Draw search results */
} search;
struct {
girara_list_t* list; /**< List of images on the page */
- bool retrieved; /**< True if we already tried to retrieve the list of images */
+ gboolean retrieved; /**< True if we already tried to retrieve the list of images */
zathura_image_t* current; /**< Image data of selected image */
} images;
@@ -52,7 +52,7 @@ typedef struct zathura_page_widget_private_s {
int x; /**< X coordinate */
int y; /**< Y coordinate */
} selection_basepoint;
- bool over_link;
+ gboolean over_link;
} mouse;
} zathura_page_widget_private_t;
@@ -313,13 +313,13 @@ zathura_page_widget_set_property(GObject* object, guin
case PROP_DRAW_LINKS:
priv->links.draw = g_value_get_boolean(value);
/* get links */
- if (priv->links.draw == true && priv->links.retrieved == false) {
+ if (priv->links.draw == TRUE && priv->links.retrieved == FALSE) {
priv->links.list = zathura_page_links_get(priv->page, NULL);
- priv->links.retrieved = true;
+ priv->links.retrieved = TRUE;
priv->links.n = (priv->links.list == NULL) ? 0 : girara_list_size(priv->links.list);
}
- if (priv->links.retrieved == true && priv->links.list != NULL) {
+ if (priv->links.retrieved == TRUE && priv->links.list != NULL) {
GIRARA_LIST_FOREACH(priv->links.list, zathura_link_t*, iter, link)
if (link != NULL) {
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, zathura_link_get_position(link));
@@ -338,7 +338,7 @@ zathura_page_widget_set_property(GObject* object, guin
}
priv->search.list = g_value_get_pointer(value);
if (priv->search.list != NULL && priv->search.draw) {
- priv->links.draw = false;
+ priv->links.draw = FALSE;
redraw_all_rects(pageview, priv->search.list);
}
priv->search.current = -1;
@@ -355,7 +355,7 @@ zathura_page_widget_set_property(GObject* object, guin
priv->search.current = girara_list_size(priv->search.list);
} else {
priv->search.current = val;
- if (priv->search.draw == true && val >= 0 && val < (signed) girara_list_size(priv->search.list)) {
+ if (priv->search.draw == TRUE && val >= 0 && val < (signed) girara_list_size(priv->search.list)) {
zathura_rectangle_t* rect = girara_list_nth(priv->search.list, priv->search.current);
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, *rect);
redraw_rect(pageview, &rectangle);

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-zathura_shortcuts_c,v 1.1 2014/11/30 23:14:48 edd Exp $
Fix incorrect use of booleans and glib that trash the stack.
https://git.pwmt.org/?p=zathura.git;a=commit;h=8d71a755d648c5856ef91d214bfdb46925f6c2f0
--- zathura/shortcuts.c.orig Sun Nov 9 22:50:01 2014
+++ zathura/shortcuts.c Sat Nov 29 18:40:34 2014
@@ -859,9 +859,11 @@ sc_search(girara_session_t* session, girara_argument_t
const unsigned int num_pages = zathura_document_get_number_of_pages(zathura->document);
const unsigned int cur_page = zathura_document_get_current_page_number(zathura->document);
GtkWidget *cur_page_widget = zathura_page_get_widget(zathura, zathura_document_get_page(zathura->document, cur_page));
- bool nohlsearch, first_time_after_abort, draw;
+ bool nohlsearch, first_time_after_abort;
+ gboolean draw;
- nohlsearch = first_time_after_abort = draw = false;
+ nohlsearch = first_time_after_abort = false;
+ draw = FALSE;
girara_setting_get(session, "nohlsearch", &nohlsearch);
if (nohlsearch == false) {

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
@comment $OpenBSD: PLIST,v 1.2 2014/11/30 23:14:48 edd Exp $
@conflict zathura-<=0.0.8.5p1
@pkgpath textproc/zathura
@bin bin/zathura
@ -14,10 +14,13 @@ lib/pkgconfig/zathura.pc
lib/zathura/
@man man/man1/zathura.1
@man man/man5/zathurarc.5
share/appdata/
share/appdata/zathura.appdata.xml
share/applications/zathura.desktop
share/dbus-1/
share/dbus-1/interfaces/
share/dbus-1/interfaces/org.pwmt.zathura.xml
share/doc/pkg-readmes/${FULLPKGNAME}
share/locale/ca/LC_MESSAGES/zathura.mo
share/locale/cs/LC_MESSAGES/zathura.mo
share/locale/de/LC_MESSAGES/zathura.mo