aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authorJannick <unknown>2017-08-28 17:03:55 +1000
committerJannick <unknown>2017-08-28 17:03:55 +1000
commit1903438d3c87909942d9d314cd6d2e2d7f5d37ca (patch)
treeb3f7b17197f3f9a7c8d2e28f5005fb58e36b0555 /lexers/LexCPP.cxx
parent9b0fe0af05ffc76aa031153f62610b1830554bad (diff)
downloadscintilla-mirror-1903438d3c87909942d9d314cd6d2e2d7f5d37ca.tar.gz
Backport: Bug [#1966]. #define A is treated as #define A 1.
Backport of changeset 6381:e4cfaeddf3a3.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 10b5535ca..5761d45f5 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -1333,6 +1333,8 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
startValue++;
std::string value = restOfLine.substr(startValue);
+ if (OnlySpaceOrTab(value))
+ value = "1"; // No value defaults to 1
preprocessorDefinitions[key] = value;
ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
definitionsChanged = true;