From e4129dd0c9ec71767eeae6ddb3f65f697c6d8140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Wed, 20 May 2015 15:58:15 +0000 Subject: [PATCH] diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error when printing the caret character. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc/ChangeLog 2015-05-20 Manuel López-Ibáñez * diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error when printing the caret character. From-SVN: r223446 --- gcc/ChangeLog | 5 +++++ gcc/diagnostic.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba1186db344..fe4dfc45e5c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-05-20 Manuel López-Ibáñez + + * diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error + when printing the caret character. + 2015-05-20 Marek Polacek * cfgexpand.c (expand_debug_expr): Use UNARY_CLASS_P. diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 8f7a9e1b478..8b70a16ad09 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -420,7 +420,8 @@ diagnostic_print_caret_line (diagnostic_context * context, int caret_min = cmin == xloc1.column ? caret1 : caret2; int caret_max = cmin == xloc1.column ? caret2 : caret1; - pp_space (context->printer); + /* cmin is >= 1, but we indent with an extra space at the start like + we did above. */ int i; for (i = 0; i < cmin; i++) pp_space (context->printer); -- 2.30.2