1 /* $Id: cleanfrom.c 6135 2003-01-19 01:15:40Z rra $
15 ** Clean up a from line, making the following transformations:
17 ** address (stuff) address
18 ** stuff <address> address
20 void HeaderCleanFrom(char *from)
26 if ((len = strlen(from)) == 0)
28 /* concatenate folded header */
29 for (p = end = from ; p < from + len ;) {
31 if ((p + 1 < from + len) && ISWHITE(p[1])) {
32 if ((p - 1 >= from) && (p[-1] == '\r')) {
50 /* Do pretty much the equivalent of sed's "s/(.*)//g"; */
51 while ((p = strchr(from, LPAREN)) && (end = strchr(p, RPAREN))) {
57 /* Do pretty much the equivalent of sed's "s/\".*\"//g"; */
58 while ((p = strchr(from, '"')) && (end = strchr(p, '"'))) {
64 /* Do the equivalent of sed's "s/.*<\(.*\)>/\1/" */
65 if ((p = strrchr(from, '<')) && (end = strrchr(p, '>'))) {
71 /* drop white spaces */
72 if ((len = strlen(from)) == 0)
74 for (p = end = from ; p < from + len ;) {