From 168bd544feb4a84139ece6cb1a02431f9f8be642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Drag=C3=A9n?= Date: Tue, 27 May 2025 14:26:52 +0200 Subject: [PATCH] fix: Parsing #version gives Unsupported directive --- lexer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lexer.cpp b/lexer.cpp index 071f00623e..92c2399398 100644 --- a/lexer.cpp +++ b/lexer.cpp @@ -270,6 +270,9 @@ void lexer::read(token &out) { return; } + // In order for strcmp to work, we need to null-terminate the string. + chars.push_back('\0'); + if (!strcmp(&chars[0], "version")) { out.asDirective.type = directive::kVersion;