diff options
| -rw-r--r-- | pkg/subsystem/linux/maintainers.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/subsystem/linux/maintainers.go b/pkg/subsystem/linux/maintainers.go index 76b2232a6..d1d65400d 100644 --- a/pkg/subsystem/linux/maintainers.go +++ b/pkg/subsystem/linux/maintainers.go @@ -140,10 +140,14 @@ func applyProperty(record *maintainersRecord, property *recordProperty) error { func parseEmail(value string) (string, error) { // Sometimes there happen extra symbols at the end of the line, // let's make this parser more error tolerant. - pos := strings.LastIndexAny(value, ">)") - if pos >= 0 { + if pos := strings.LastIndexAny(value, ">)"); pos >= 0 { value = value[:pos+1] } + // Let's also make the parser more robust by skipping everything before the first <, + // if it exists. + if pos := strings.LastIndexAny(value, "<"); pos >= 0 { + value = value[pos:] + } addr, err := mail.ParseAddress(value) if err != nil { return "", err |
