diff --git a/type/__mail_alias/explorer/aliases b/type/__mail_alias/explorer/aliases index 5b5d68d..ac13d7c 100755 --- a/type/__mail_alias/explorer/aliases +++ b/type/__mail_alias/explorer/aliases @@ -31,7 +31,7 @@ function print_aliases(aliases, matches) { split(aliases, matches, /,[ \t]*/) for (i in matches) { 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 # 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 - # (the contents have been printed above if they should) - if (cont) { - sub(/[ \t]*\\$/, "", $0) - next - } + # if it is, we drop the backslash from the line + if (cont) sub(/[ \t]*\\$/, "", $0) } is_cont { diff --git a/type/__mail_alias/files/update_aliases.awk b/type/__mail_alias/files/update_aliases.awk index 87ea202..336009f 100644 --- a/type/__mail_alias/files/update_aliases.awk +++ b/type/__mail_alias/files/update_aliases.awk @@ -67,14 +67,12 @@ BEGIN { is_cont = /^[ \t]/ || cont # detect if the line is a line to be continued (ends with a backslash) - cont = ($0 ~ /\\$/) - # if it is, we drop the backslash from the line. - if (cont) sub(/[ \t]*\\$/, "", $0) + cont = /\\$/ } is_cont { - # we ignore the line as it has been rewritten previously or is not - # interesting + # we only print the line if it has not been rewritten (select) + if (!select) print next }