Matteo Bruni : vkd3d-shader/preproc: Don't add additional spaces after whitespace tokens.
Alexandre Julliard
julliard at winehq.org
Thu Mar 31 15:01:44 CDT 2022
Module: vkd3d
Branch: master
Commit: d2104522fe42cc565c431c7aecb14d00fb32e741
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=d2104522fe42cc565c431c7aecb14d00fb32e741
Author: Matteo Bruni <mbruni at 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 at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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;
}
More information about the wine-cvs
mailing list