This is especially a problem when e.g. it introduces a whitespace before a #pragma directive, breaking shader compilation.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- libs/vkd3d-shader/preproc.l | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l index 20cb0c35..7686e018 100644 --- a/libs/vkd3d-shader/preproc.l +++ b/libs/vkd3d-shader/preproc.l @@ -578,7 +578,10 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner) if (ctx->current_directive) return return_token(token, lval, text);
- vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text); + if (isspace(text[0])) + vkd3d_string_buffer_printf(&ctx->buffer, "%s", text); + else + vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text); break; }