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>
This commit is contained in:
Matteo Bruni 2022-03-30 23:38:32 +02:00 committed by Alexandre Julliard
parent a75560af3d
commit d2104522fe

View File

@ -578,6 +578,9 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
if (ctx->current_directive)
return return_token(token, lval, text);
if (isspace(text[0]))
vkd3d_string_buffer_printf(&ctx->buffer, "%s", text);
else
vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text);
break;
}