commit - 67c4c153acf0aeb91d39ea45524663e032ab2fe6
commit + 75b7a700d9d14ef8eb902961255212acbedef164
blob - 1a2d03cda24f7afe7ef3cb27b7b9683cbf87fe65
blob + c57eaabaef3b116c178390d76ee554ebbb2e16e9
--- lib/blame.c
+++ lib/blame.c
err = blame_open(&blame, abspath, commit_id, repo, cb, arg);
free(abspath);
- blame_close(blame);
+ if (err == NULL)
+ blame_close(blame);
return err;
}
blob - 4404ee43ec1521f107a9d8924d5d1c0b20c921cd
blob + 581999675170afab7819c5cb96bad859a29b2545
--- tog/tog.c
+++ tog/tog.c
WINDOW *window;
int *first_displayed_line;
int *last_displayed_line;
+ int *done;
};
static const struct got_error *
struct tog_blame_cb_args *a = arg;
struct tog_blame_line *line;
int eof;
+
+ if (*a->done)
+ return got_error(GOT_ERR_ITER_COMPLETED);
if (nlines != a->nlines || lineno < 1 || lineno > a->nlines)
return got_error(GOT_ERR_RANGE);
blame_cb_args.window = tog_blame_view.window;
blame_cb_args.first_displayed_line = &first_displayed_line;
blame_cb_args.last_displayed_line = &last_displayed_line;
+ blame_cb_args.done = &done;
blame_thread_args.path = path;
blame_thread_args.commit_id = commit_id;
if (thread) {
if (pthread_join(thread, (void **)&err) != 0)
err = got_error_from_errno();
+ if (err && err->code == GOT_ERR_ITER_COMPLETED)
+ err = NULL;
}
if (blob)
got_object_blob_close(blob);