replace '${foo+repl}' pattern with '${foo:+repl}' (latest supports $foo being defined but empty)
mentioned in commit 4e7a9183