Only increment the buffer location for macro output whitespace stripping if the situa...
authorDale Weiler <weilercdale@gmail.com>
Tue, 8 Apr 2014 08:02:23 +0000 (04:02 -0400)
committerDale Weiler <weilercdale@gmail.com>
Tue, 8 Apr 2014 08:02:23 +0000 (04:02 -0400)
ftepp.c

diff --git a/ftepp.c b/ftepp.c
index c1052def52e627a6d073ab83ed0911073b2ee9fd..b974f4fa83a81338b4b080b8e35eb92da8a57afe 100644 (file)
--- a/ftepp.c
+++ b/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);