summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/dtc/input_buffer.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/dtc/input_buffer.cc b/usr.bin/dtc/input_buffer.cc
index 8f055fe..c83044d 100644
--- a/usr.bin/dtc/input_buffer.cc
+++ b/usr.bin/dtc/input_buffer.cc
@@ -151,7 +151,7 @@ input_buffer::next_token()
start = cursor;
skip_spaces();
// Parse /* comments
- if (((*this)[0] == '/') && ((*this)[1] == '*'))
+ if ((*this)[0] == '/' && (*this)[1] == '*')
{
// eat the start of the comment
++(*this);
@@ -168,13 +168,14 @@ input_buffer::next_token()
// Eat the /
++(*this);
}
- // Parse // comments
- if (((*this)[0] == '/') && ((*this)[1] == '/'))
+ // Parse // comments and # comments
+ if (((*this)[0] == '/' && (*this)[1] == '/') ||
+ (*this)[0] == '#')
{
// eat the start of the comment
++(*this);
++(*this);
- // Find the ending * of */
+ // Find the ending of the line
while (**this != '\n')
{
++(*this);
OpenPOWER on IntegriCloud