Skip to content

Commit

Permalink
Ignore empty root strings when choosing output format (chainguard-dev…
Browse files Browse the repository at this point in the history
…#235)

Signed-off-by: egibs <[email protected]>
  • Loading branch information
egibs authored May 22, 2024
1 parent a2e2769 commit 273966f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/action/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func scanSinglePath(ctx context.Context, c Config, yrs *yara.Rules, path string,

// If absPath is provided, use it instead of the path if they are different.
// This is useful when scanning images and archives.
if absPath != "" && absPath != path {
if absPath != "" && absPath != path && root != "" {
fr.Path = fmt.Sprintf("%s ∴ %s", absPath, formatPath(cleanPath(path, root)))
}

Expand Down

0 comments on commit 273966f

Please sign in to comment.