summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/src/expand.c3
-rw-r--r--test/scripts/0000-Basic/00021
-rw-r--r--test/stdout/00021
3 files changed, 4 insertions, 1 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index 7c9d48100..2c29c26d5 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -6186,11 +6186,12 @@ while (*s != 0)
case 2:
case 3: goto EXPAND_FAILED;
}
- for (uschar sep = *sub[0], c; c = *sub[1]; sub[1]++)
+ if (*sub[1]) for (uschar sep = *sub[0], c; c = *sub[1]; sub[1]++)
{
if (c == sep) yield = string_catn(yield, sub[1], 1);
yield = string_catn(yield, sub[1], 1);
}
+ else yield = string_catn(yield, US" ", 1);
continue;
}
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index db8d70981..a8fc0bcb2 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -133,6 +133,7 @@ listquote: ${listquote{:}{ab::cd}}
listquote: ${listquote{;}{ab:cd}}
listquote: ${listquote{;}{ab;cd}}
listquote: ${listquote{ }{ ab cd}}
+listquote: <${listquote{:}{}}>
sort: ${sort{3:2:1:4}{<}{$item}}
sort: ${sort {<, 3,2,1,4}{>}{$item}}
diff --git a/test/stdout/0002 b/test/stdout/0002
index ea918aebb..b8ff36122 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -122,6 +122,7 @@
> listquote: ab:cd
> listquote: ab;;cd
> listquote: ab cd
+> listquote: < >
>
> sort: 1:2:3:4
> sort: 4,3,2,1