From f854ff4c520183dbd820f61b958c9794cfd3a1fd Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 31 Oct 2018 11:11:15 +0100 Subject: [PATCH] fix token concatenation --- src/token.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/token.c b/src/token.c index 29dcb42..df7d2e8 100644 --- a/src/token.c +++ b/src/token.c @@ -91,13 +91,12 @@ struct psi_token *psi_token_cat(const char *sep, unsigned argc, ...) { T->type = PSI_T_NAME; T->file = zend_string_copy(T->file); + smart_str_append_ex(&text, T->text, 1); + for (i = 1; i < argc; ++i) { struct psi_token *arg = va_arg(argv, struct psi_token *); - if (sep_len && text.a) { - smart_str_appendl_ex(&text, sep, sep_len, 1); - } - + smart_str_appendl_ex(&text, sep, sep_len, 1); smart_str_append_ex(&text, arg->text, 1); } va_end(argv); -- 2.30.2