mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-20 18:32:01 +00:00
Only increment the buffer location for macro output whitespace stripping if the situation is actually stripable, otherwise macros like #define foo(X) bar(#X), with foo(test) will expand to bartest) instead of bar(test). This should fix Xonotic builds.
This commit is contained in:
parent
15d1277158
commit
0db41f4279
1 changed files with 3 additions and 2 deletions
5
ftepp.c
5
ftepp.c
|
@ -849,10 +849,11 @@ static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *param
|
|||
break;
|
||||
default:
|
||||
buffer = out->value;
|
||||
if (vec_size(macro->output) > o + 1 && macro->output[o+1]->token == '#')
|
||||
#define buffer_stripable(X) ((X) == ' ' || (X) == '\t')
|
||||
if (vec_size(macro->output) > o + 1 && macro->output[o+1]->token == '#' && buffer_stripable(*buffer))
|
||||
buffer++;
|
||||
if (strip) {
|
||||
while (*buffer == ' ' || *buffer == '\t') buffer++;
|
||||
while (buffer_stripable(*buffer)) buffer++;
|
||||
strip = false;
|
||||
}
|
||||
ftepp_out(ftepp, buffer, false);
|
||||
|
|
Loading…
Reference in a new issue