Ignore lines starting with '#'

Fixes #1171
This commit is contained in:
Frank Denis 2020-01-30 16:16:05 +01:00
parent 3a94523d65
commit a6026ce48a
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
##################
# Test blacklist #
##################
ad.*
ads.*
banner.*

View File

@ -145,7 +145,7 @@ func StringStripSpaces(str string) string {
func TrimAndStripInlineComments(str string) string {
if idx := strings.LastIndexByte(str, '#'); idx >= 0 {
if idx == 0 {
if idx == 0 || str[0] == '#' {
return ""
}
if prev := str[idx-1]; prev == ' ' || prev == '\t' {