aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/lexer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cc/lexer.cxx')
-rw-r--r--build2/cc/lexer.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/build2/cc/lexer.cxx b/build2/cc/lexer.cxx
index faf73c8..ba6ea18 100644
--- a/build2/cc/lexer.cxx
+++ b/build2/cc/lexer.cxx
@@ -330,6 +330,13 @@ namespace build2
if (alpha (c) || c == '_')
{
+ // This smells a little: we know skip_spaces() did not peek at
+ // the next character because this is not '/'. Which means the
+ // position in the stream must be of this character + 1.
+ //
+ if (buf_ != nullptr)
+ t.position = buf_->tellg () - 1;
+
string& id (t.value);
id.clear ();