From: Lucian Poston Date: Mon, 16 Apr 2012 10:44:54 GMT Subject: [PATCH v3 6/7] Prevent graph_width of diff stat from falling below min Message-ID: <1334573095-32286-7-git-send-email-lucian.poston@gmail.com> In-Reply-To: <1334573095-32286-1-git-send-email-lucian.poston@gmail.com> Signed-off-by: Lucian Poston --- diff.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/diff.c b/diff.c index 0b61cf7..f08b41a 100644 --- a/diff.c +++ b/diff.c @@ -1473,8 +1473,12 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options) * Adjust adjustable widths not to exceed maximum width */ if (name_width + number_width + 6 + graph_width > width) { - if (graph_width > width * 3/8 - number_width - 6) + if (graph_width > width * 3/8 - number_width - 6) { graph_width = width * 3/8 - number_width - 6; + if (graph_width < 6) + graph_width = 6; + } + if (options->stat_graph_width && graph_width > options->stat_graph_width) graph_width = options->stat_graph_width; -- 1.7.3.4