浏览代码

Allow comments with `#` in expr wordlists

Co-authored-by: AlteredCoder <AlteredCoder>
AlteredCoder 5 年之前
父节点
当前提交
d0ac43b00f
共有 1 个文件被更改,包括 3 次插入0 次删除
  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()))