goto the right label, so we can get previous on the last page of briefs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 67d7b13..7d851f4 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -3521,7 +3521,7 @@ gw_get_commits(struct gw_trans * gw_trans, struct gw_header *header,
error = got_commit_graph_iter_start(graph, id, gw_trans->repo, NULL,
NULL);
if (error)
- goto done;
+ goto err;
for (;;) {
error = got_commit_graph_iter_next(&id, graph, gw_trans->repo,
@@ -3529,14 +3529,14 @@ gw_get_commits(struct gw_trans * gw_trans, struct gw_header *header,
if (error) {
if (error->code == GOT_ERR_ITER_COMPLETED)
error = NULL;
- goto err;
+ goto done;
}
if (id == NULL)
goto err;
error = got_object_open_as_commit(&commit, gw_trans->repo, id);
- if (error)
- goto err;
+ if (error)
+ goto err;
if (limit == 1 && chk_multi == 0 &&
gw_trans->gw_conf->got_max_commits_display != 1) {
error = gw_get_commit(gw_trans, header, commit, id);
@@ -3618,7 +3618,6 @@ done:
c_cnt++;
}
}
-
err:
if (commit != NULL)
got_object_commit_close(commit);