From 8d9c80995077820e5a4c361c739eed618513847f Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Wed, 14 Aug 2013 14:34:02 +0000 Subject: [PATCH] Make carets line up in dtc diagnostics if the line starts with a tab. --- usr.bin/dtc/input_buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/dtc/input_buffer.cc b/usr.bin/dtc/input_buffer.cc index 10b3a0018be3..8f055fe61d72 100644 --- a/usr.bin/dtc/input_buffer.cc +++ b/usr.bin/dtc/input_buffer.cc @@ -216,7 +216,8 @@ input_buffer::parse_error(const char *msg) putc('\n', stderr); for (int i=0 ; i<(cursor-line_start) ; ++i) { - putc(' ', stderr); + char c = (buffer[i+line_start] == '\t') ? '\t' : ' '; + putc(c, stderr); } putc('^', stderr); putc('\n', stderr);