Module: vkd3d Branch: master Commit: d2104522fe42cc565c431c7aecb14d00fb32e741 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=d2104522fe42cc565c431c7a...
Author: Matteo Bruni mbruni@codeweavers.com Date: Wed Mar 30 23:38:32 2022 +0200
vkd3d-shader/preproc: Don't add additional spaces after whitespace tokens.
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 Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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; }