From 5e0bc081e602f1abb01d3f3720a075a8e7b56d3e Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Mon, 21 Jun 2021 00:57:26 +0800 Subject: [PATCH] frontend: allow long lines if result is short --- frontend/dn42.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/dn42.go b/frontend/dn42.go index 8d5f8c9..5f97ff8 100644 --- a/frontend/dn42.go +++ b/frontend/dn42.go @@ -64,7 +64,6 @@ func shortenWhoisFilter(whois string) string { shouldSkip := false shouldSkip = shouldSkip || len(s) == 0 - shouldSkip = shouldSkip || len(s) > 80 shouldSkip = shouldSkip || len(s) > 0 && s[0] == '#' if shouldSkip { @@ -75,6 +74,7 @@ func shortenWhoisFilter(whois string) string { commandResultLonger += s + "\n" linesLonger++ + shouldSkip = shouldSkip || len(s) > 80 shouldSkip = shouldSkip || !strings.Contains(s, ":") shouldSkip = shouldSkip || strings.Index(s, ":") > 20 @@ -87,7 +87,7 @@ func shortenWhoisFilter(whois string) string { lines++ } - if lines < 10 { + if lines < 5 { commandResult = commandResultLonger skippedLines = skippedLinesLonger }