Discussion:
[zathura] [Zathura PATCH 1/2] Logical error fix and cleanup for zathura_jumplist_reset_current
Marwan Tanager
2013-06-30 16:06:48 UTC
Permalink
---
zathura.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/zathura.c b/zathura.c
index 665cda0..b465cb6 100644
--- a/zathura.c
+++ b/zathura.c
@@ -1220,18 +1220,14 @@ zathura_jumplist_backward(zathura_t* zathura)
static void
zathura_jumplist_reset_current(zathura_t* zathura)
{
- g_return_if_fail(zathura != NULL || zathura->jumplist.cur != NULL);
-
- if (girara_list_iterator_has_next(zathura->jumplist.cur) == false) {
- return;
- }
+ g_return_if_fail(zathura != NULL && zathura->jumplist.cur != NULL);

while (true) {
- girara_list_iterator_next(zathura->jumplist.cur);
-
if (girara_list_iterator_has_next(zathura->jumplist.cur) == false) {
return;
}
+
+ girara_list_iterator_next(zathura->jumplist.cur);
}
}
--
1.7.10.4
Marwan Tanager
2013-06-30 16:06:49 UTC
Permalink
---
zathura.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zathura.c b/zathura.c
index b465cb6..0165e40 100644
--- a/zathura.c
+++ b/zathura.c
@@ -1267,9 +1267,9 @@ zathura_jumplist_trim(zathura_t* zathura)
--zathura->jumplist.size;
}

- if (zathura->jumplist.size == 0) {
+ if (zathura->jumplist.size == 0 || (zathura->jumplist.size != 0 && zathura->jumplist.cur != NULL)) {
girara_list_iterator_free(cur);
- } else if (zathura->jumplist.cur == NULL) {
+ } else {
zathura->jumplist.cur = cur;
}
}
--
1.7.10.4
Marwan Tanager
2013-06-30 16:11:39 UTC
Permalink
I sent this patch two weeks ago with the name "Fix", but it seems that it has
been forgotten, so I send it here again with a more descriptive commit message.


--
Marwan
Sebastian Ramacher
2013-06-30 16:37:04 UTC
Permalink
Post by Marwan Tanager
I sent this patch two weeks ago with the name "Fix", but it seems that it has
been forgotten, so I send it here again with a more descriptive commit message.
Looks like I missed that one. Applied now.
--
Sebastian Ramacher
Marwan Tanager
2013-06-30 16:42:56 UTC
Permalink
Post by Sebastian Ramacher
Post by Marwan Tanager
I sent this patch two weeks ago with the name "Fix", but it seems that it has
been forgotten, so I send it here again with a more descriptive commit message.
Looks like I missed that one. Applied now.
Thanks.


--
Marwan

Loading...