[type/__mail_alias] Fix continuation line processing

This commit is contained in:
Dennis Camera 2020-10-01 13:45:20 +02:00
parent c6b795b3f9
commit f202d11124
2 changed files with 7 additions and 13 deletions

View file

@ -31,7 +31,7 @@ function print_aliases(aliases, matches) {
split(aliases, matches, /,[ \t]*/) split(aliases, matches, /,[ \t]*/)
for (i in matches) { for (i in matches) {
gsub(/^[ \t]*|[ \t]*$/, "", matches[i]) gsub(/^[ \t]*|[ \t]*$/, "", matches[i])
print matches[i] if (matches[i]) print matches[i]
} }
} }
@ -47,14 +47,10 @@ function print_aliases(aliases, matches) {
is_cont = /^[ \t]/ || cont is_cont = /^[ \t]/ || cont
# detect if the line is a line to be continued (ends with a backslash) # detect if the line is a line to be continued (ends with a backslash)
cont = ($0 ~ /\\$/) cont = /\\$/
# if it is, we drop the backslash from the line and skip to next line # if it is, we drop the backslash from the line
# (the contents have been printed above if they should) if (cont) sub(/[ \t]*\\$/, "", $0)
if (cont) {
sub(/[ \t]*\\$/, "", $0)
next
}
} }
is_cont { is_cont {

View file

@ -67,14 +67,12 @@ BEGIN {
is_cont = /^[ \t]/ || cont is_cont = /^[ \t]/ || cont
# detect if the line is a line to be continued (ends with a backslash) # detect if the line is a line to be continued (ends with a backslash)
cont = ($0 ~ /\\$/) cont = /\\$/
# if it is, we drop the backslash from the line.
if (cont) sub(/[ \t]*\\$/, "", $0)
} }
is_cont { is_cont {
# we ignore the line as it has been rewritten previously or is not # we only print the line if it has not been rewritten (select)
# interesting if (!select) print
next next
} }