[type/__dma_auth] Fix off-by-one error

This commit is contained in:
Dennis Camera 2020-06-11 15:09:51 +02:00
parent 96fcccf529
commit ca9e011d50
2 changed files with 6 additions and 3 deletions

View File

@ -64,7 +64,7 @@ BEGIN {
host = substr($0, length(login) + 2)
if (match(host, DP)) {
passwd = substr(host, RSTART)
passwd = substr(host, RSTART + 1)
host = substr(host, 1, RSTART - 1)
} else {
passwd = ""

View File

@ -99,7 +99,10 @@ BEGIN {
}
# skip comments and empty lines
/^#/ || /^$/ { print; next }
/^#/ || /^$/ {
print
next
}
{
# parse line
@ -110,7 +113,7 @@ BEGIN {
host = substr($0, length(login) + 2)
if (match(host, DP)) {
passwd = substr(host, RSTART)
passwd = substr(host, RSTART + 1)
host = substr(host, 1, RSTART - 1)
} else {
passwd = ""