From: Michael Wallner Date: Wed, 31 Oct 2018 10:11:15 +0000 (+0100) Subject: fix token concatenation X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=commitdiff_plain;h=f854ff4c520183dbd820f61b958c9794cfd3a1fd fix token concatenation --- 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);