Commit 0e8d5bfe 0e8d5bfe95e90df34616f780c9e11c076ca306c3 by Sergey Poznyakoff

wordsplit: minor fix in return_delims mode

* libmailutils/string/wordsplit.c (scan_word): Return only one delimiter
if MU_WRDSF_RETURN_DELIMS is on
* libmailutils/tests/wordsplit.at: Reflect that.
1 parent 9316bc63
......@@ -1155,11 +1155,7 @@ scan_word (struct mu_wordsplit *wsp, size_t start)
}
else if (wsp->ws_flags & MU_WRDSF_RETURN_DELIMS)
{
do
{
i++;
}
while (i < len && ISDELIM (wsp, command[i]));
i++;
}
else if (!(wsp->ws_flags & MU_WRDSF_SQUEEZE_DELIMS))
flags |= _WSNF_EMPTYOK;
......
......@@ -275,16 +275,17 @@ TESTWSP([custom, with returned delimiters],[],[delim : -ws trimnl return_delims]
TESTWSP([custom, with returned & squeezed delimiters],[],[delim : -ws trimnl return_delims -squeeze_delims],
[semicolon: separated::list: of :words],
[NF: 9
[NF: 10
0: semicolon
1: :
2: " separated"
3: ::
4: list
5: :
6: " of "
7: :
8: words
3: :
4: :
5: list
6: :
7: " of "
8: :
9: words
])
TESTWSP([sed expressions],[],[sed],
......