Fix extract_first_email_addr() to really return the first email

The use of find_all() in extract_email_addrs_vec() extracted occurrences
to an intermediate set and thus lost any sense of ordering.

This changes extract_email_addrs_vec() to use find_all_ordered() and
return all occurrences of email addresses found in the argument,
included duplicates, with their order of occurrence preserved.
This commit is contained in:
Jon Siwek 2020-08-06 18:08:20 -07:00 committed by Tim Wojtulewicz
parent a852ab4c39
commit 170752fa99
5 changed files with 47 additions and 4 deletions

5
NEWS
View file

@ -27,6 +27,11 @@ Changed Functionality
- The use as enum of type ``NetControl::RuleType`` is unchanged and still
named ``NetControl::DROP``
- The extract_email_addrs_vec() BIF now returns all occurrences of emails,
including duplicates, with preserved order of occurrence. This seems like
the original/documented intent of the function, but the previous
implementation did not preserve ordering or duplicates.
Removed Functionality
---------------------