diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2014-06-10 06:16:34 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2014-06-10 06:16:34 +0000 |
commit | a383cdc1ffeda39a6c2bd6d08ae8d25d0a30ea3b (patch) | |
tree | 8be0524794132f758537b6357e81d8d7aeed5bdd /usr.bin/dtc | |
parent | 64f82214b7403af0a60fe51e905eb9f895583798 (diff) | |
download | FreeBSD-src-a383cdc1ffeda39a6c2bd6d08ae8d25d0a30ea3b.zip FreeBSD-src-a383cdc1ffeda39a6c2bd6d08ae8d25d0a30ea3b.tar.gz |
dtc: ignore lines starting with #.
This is necessary because we use the C pre-processor to parse #include lines
and cpp adds line markings that start with #.
Diffstat (limited to 'usr.bin/dtc')
-rw-r--r-- | usr.bin/dtc/input_buffer.cc | 9 |
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); |