Parcourir la source

Allow comments with `#` in expr wordlists

Co-authored-by: AlteredCoder <AlteredCoder>
AlteredCoder il y a 5 ans
Parent
commit
d0ac43b00f
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      pkg/exprhelpers/exprlib.go

+ 3 - 0
pkg/exprhelpers/exprlib.go

@@ -68,6 +68,9 @@ func FileInit(fileFolder string, filename string, fileType string) error {
 	}
 	scanner := bufio.NewScanner(file)
 	for scanner.Scan() {
+		if strings.HasPrefix(scanner.Text(), "#") { // allow comments
+			continue
+		}
 		switch fileType {
 		case "regex", "regexp":
 			dataFileRegex[filename] = append(dataFileRegex[filename], regexp.MustCompile(scanner.Text()))