Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/regex_compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ func performCompare(processAll bool, ctx *processors.Context) error {
if err != nil && len(chainOffsetString) > 0 {
return errors.New("failed to match chain offset. Value must not be larger than 255")
}
regex := runAssemble(filePath)
regex, err := runAssemble(filePath)
if err != nil {
return err
}
err = processRegexForCompare(id, uint8(chainOffset), regex, ctx)
if err != nil && errors.Is(err, &ComparisonError{}) {
failed = true
Expand All @@ -156,7 +159,10 @@ func performCompare(processAll bool, ctx *processors.Context) error {
return &ComparisonError{}
}
} else {
regex := runAssemble(path.Join(ctx.RootContext().AssemblyDir(), ruleValues.fileName))
regex, err := runAssemble(path.Join(ctx.RootContext().AssemblyDir(), ruleValues.fileName))
if err != nil {
return err
}
return processRegexForCompare(ruleValues.id, ruleValues.chainOffset, regex, ctx)
}
return nil
Expand Down
Loading
Loading