not append ; if end of the list in StringJoin (#3672)

pull/3667/head^2
SaitTalhaNisanci 2020-03-31 10:01:28 +03:00 committed by GitHub
parent 67d2ad4e37
commit 8dfc2cb122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -165,10 +165,15 @@ StringJoin(List *stringList, char delimiter)
StringInfo joinedString = makeStringInfo();
const char *command = NULL;
int curIndex = 0;
foreach_ptr(command, stringList)
{
if (curIndex > 0)
{
appendStringInfoChar(joinedString, delimiter);
}
appendStringInfoString(joinedString, command);
appendStringInfoChar(joinedString, delimiter);
curIndex++;
}
return joinedString->data;