basic/strv: fix strv_join for first empty argument
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Feb 2016 04:24:14 +0000 (23:24 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 13 Feb 2016 16:54:39 +0000 (11:54 -0500)
commitafe773b01a704b98a350a36fa518bfcd6a54323b
treec2ce124ff5fbe8314b7d7932696f7e59e7ebce6b
parent06e948901a6f70b4d10c90d05a174da0663d1aba
basic/strv: fix strv_join for first empty argument

Empty strings were ignored in strv_join, but only if they were at the beginning
of the string. Empty strings after at least one non-empty item were treated
normally.

Previously:
{"x"} → "x"
{"x", ""} → "x"
{"x", "", ""} → "x::"
{""} → ""
{"", ""} → ""
{"", "", ""} → ""
{"", "x"} → "x"
{"", "x", ""} → "x:"
Now:
{"x"} → "x"
{"x", ""} → "x"
{"x", "", ""} → "x::"
{""} → ""
{"", ""} → ":"
{"", "", ""} → "::"
{"", "x"} → ":x"
{"", "x", ""} → ":x:"
src/basic/strv.c
src/test/test-strv.c