awk: FS regex matches only non-empty separators (gawk compat)
function old new delta awk_split 484 553 +69 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -398,5 +398,12 @@ testing 'awk do not allow "str"++' \
|
||||
'' \
|
||||
'anything'
|
||||
|
||||
#gawk compat: FS regex matches only non-empty separators:
|
||||
#with -*, the splitting is NOT f o o b a r, but foo bar:
|
||||
testing 'awk FS regex which can match empty string' \
|
||||
"awk -F '-*' '{print \$1 \"-\" \$2 \"=\" \$3 \"*\" \$4}'" \
|
||||
"foo-bar=*\n" \
|
||||
'' \
|
||||
'foo--bar'
|
||||
|
||||
exit $FAILCOUNT
|
||||
|
Reference in New Issue
Block a user