aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2013-08-14 14:34:02 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2013-08-14 14:34:02 +0000
commit8d9c80995077820e5a4c361c739eed618513847f (patch)
tree67f07212515beba56ca35f3133e4a190c2ab8e17 /usr.bin
parent4a62545173e60b96a134674f5be516338255dcd9 (diff)
downloadsrc-8d9c80995077820e5a4c361c739eed618513847f.tar.gz
src-8d9c80995077820e5a4c361c739eed618513847f.zip
Make carets line up in dtc diagnostics if the line starts with a tab.
Notes
Notes: svn path=/head/; revision=254327
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/dtc/input_buffer.cc3
1 files changed, 2 insertions, 1 deletions
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);