forked from ungleich-public/cdist-contrib
[type/__mail_alias] Fix continuation line processing
This commit is contained in:
parent
c6b795b3f9
commit
f202d11124
2 changed files with 7 additions and 13 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue