diff --git a/ppremake/ppScope.cxx b/ppremake/ppScope.cxx index adb70e3991..e659ebf68f 100644 --- a/ppremake/ppScope.cxx +++ b/ppremake/ppScope.cxx @@ -2401,19 +2401,18 @@ expand_wordsubst(const string ¶ms) { string PPScope:: expand_join(const string ¶ms) { // Split the string up into tokens based on the spaces. - vector words; - tokenize_whitespace(expand_string(params), words); + vector tokens; + tokenize_params(params, tokens, true); - if (words.size() < 2) { - cerr << "joins requires at least two parameters.\n"; + if (tokens.size() != 2) { + cerr << "join requires two parameters.\n"; return string(); } - const string sep(words[0]); + const string &sep = tokens[0]; + vector words; + tokenize_whitespace(expand_string(tokens[1]), words); - // Remove the first word in the list (which we use as the separator). - words.erase(words.begin()); - string result = repaste(words, sep); return result; }