Commit 646f136f 646f136fd784383d331020fb54b391fbecc0caea by Sam Roberts

Group names no longer appearing in address lists (still parsed correctly).

1 parent 0a76ac8e
...@@ -53,14 +53,14 @@ struct parse822_token_t { ...@@ -53,14 +53,14 @@ struct parse822_token_t {
53 const char* b; // beginning of token 53 const char* b; // beginning of token
54 const char* e; // one past end of token 54 const char* e; // one past end of token
55 } 55 }
56 typedef struc parse822_token_t TOK; 56 typedef struct parse822_token_t TOK;
57 57
58 Then I can have str_append_token(), and the lexer functions can 58 Then I can have str_append_token(), and the lexer functions can
59 look like: 59 look like:
60 60
61 int parse822_atom(const char** p, const char* e, TOK* atom); 61 int parse822_atom(const char** p, const char* e, TOK* atom);
62 62
63 Just a quick though, I'll have to see how many functions that will 63 Just a quick thought, I'll have to see how many functions that will
64 actually help. 64 actually help.
65 65
66 - get example addresses from rfc2822, and from the perl code. 66 - get example addresses from rfc2822, and from the perl code.
...@@ -708,6 +708,11 @@ int parse822_address(const char** p, const char* e, address_t* a) ...@@ -708,6 +708,11 @@ int parse822_address(const char** p, const char* e, address_t* a)
708 return rc; 708 return rc;
709 } 709 }
710 710
711 /* No longer put groups into an address node, it wasn't useful, was
712 * troublesome, and since there wasn't an end-group marker, wasn't
713 * even conceivably useful.
714 */
715 #undef ADD_GROUPS
711 int parse822_group(const char** p, const char* e, address_t* a) 716 int parse822_group(const char** p, const char* e, address_t* a)
712 { 717 {
713 /* group = phrase ":" [#mailbox] ";" */ 718 /* group = phrase ":" [#mailbox] ";" */
...@@ -732,7 +737,7 @@ int parse822_group(const char** p, const char* e, address_t* a) ...@@ -732,7 +737,7 @@ int parse822_group(const char** p, const char* e, address_t* a)
732 str_free(&phrase); 737 str_free(&phrase);
733 return rc; 738 return rc;
734 } 739 }
735 740 #ifdef ADD_GROUPS
736 /* fake up an address node for the group's descriptive phrase, if 741 /* fake up an address node for the group's descriptive phrase, if
737 * it fails, clean-up will happen after the loop 742 * it fails, clean-up will happen after the loop
738 */ 743 */
...@@ -741,6 +746,9 @@ int parse822_group(const char** p, const char* e, address_t* a) ...@@ -741,6 +746,9 @@ int parse822_group(const char** p, const char* e, address_t* a)
741 } else { 746 } else {
742 str_free(&phrase); 747 str_free(&phrase);
743 } 748 }
749 #else
750 str_free(&phrase);
751 #endif
744 752
745 /* Basically, on each loop, we may find a mailbox, but we must find 753 /* Basically, on each loop, we may find a mailbox, but we must find
746 * a comma after the mailbox, otherwise we've popped off the end 754 * a comma after the mailbox, otherwise we've popped off the end
......