From d1fdcaeab47cda08b5d77cfe07c35c3709c25047 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 12 Aug 2016 10:42:03 -0300 Subject: [PATCH] eeshow/gui.c: limit = 0 means "no limit", not "no revisions" --- eeshow/gui.c | 5 +++-- eeshow/main.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eeshow/gui.c b/eeshow/gui.c index fe968c8..1630f8f 100644 --- a/eeshow/gui.c +++ b/eeshow/gui.c @@ -1234,7 +1234,8 @@ static void add_hist(void *user, struct hist *h) if (!ahc->limit) return; - ahc->limit--; + if (ahc->limit > 0) + ahc->limit--; prev = NULL; for (anchor = &ctx->hist; *anchor; anchor = &(*anchor)->next) { @@ -1263,7 +1264,7 @@ static void get_revisions(struct gui_ctx *ctx, .n_args = n_args, .args = args, .recurse = recurse, - .limit = limit < 0 ? -limit : limit, + .limit = limit ? limit < 0 ? -limit : limit : -1, }; if (!vcs_git_try(sch_name)) { diff --git a/eeshow/main.c b/eeshow/main.c index d8313b9..6c93129 100644 --- a/eeshow/main.c +++ b/eeshow/main.c @@ -56,7 +56,7 @@ void usage(const char *name) " -v increase verbosity of diagnostic output\n" " -C 'cat' the file to standard output\n" " -H show history of repository on standard output\n" -" -N n limit history to n revisions\n" +" -N n limit history to n revisions (unlimited if omitted or 0)\n" "\n" "No driver spec: enter GUI\n" "\n"