summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-10 17:27:09 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-10 17:27:09 -0300
commit10df353188f98b454723af33278f5a731a27040c (patch)
tree1e0335b49cfb4c018feeb889e1b9577edf6175ed /gui
parent084af9fe5f9aaa58292f4a83aa9e28c27065b94f (diff)
downloadeeshow-10df353188f98b454723af33278f5a731a27040c.tar.gz
eeshow-10df353188f98b454723af33278f5a731a27040c.tar.bz2
eeshow-10df353188f98b454723af33278f5a731a27040c.zip
gui/gui.c (get_history): calculate hist_size correctly
This value is only used for the progress bar, so nothing bad happens if we use too high a value (with -N 10000 or such), but it's still better to do this properly.
Diffstat (limited to 'gui')
-rw-r--r--gui/gui.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/gui.c b/gui/gui.c
index 47860af..f218283 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -419,10 +419,11 @@ static void get_history(struct gui *gui, const char *name, int limit)
}
gui->vcs_history = vcs_git_history(name);
- if (limit)
- gui->hist_size = limit > 0 ? limit : -limit;
- else
- hist_iterate(gui->vcs_history, count_history, gui);
+ hist_iterate(gui->vcs_history, count_history, gui);
+ if (limit < 0)
+ limit = -limit;
+ if (limit && gui->hist_size > limit)
+ gui->hist_size = limit;
}