From c7b582a4a56b2b2252588a222a81835d00a41327 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 7 Oct 2003 15:56:17 +0000 Subject: [PATCH] * Better handling of incoming Internet addresses consisting of an address in angle brackets with no name outside the brackets. --- citadel/ChangeLog | 5 +++++ citadel/internet_addressing.c | 8 ++++++++ citadel/tools.c | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 56396150d..1183eee35 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 610.19 2003/10/07 15:56:17 ajc + * Better handling of incoming Internet addresses consisting of an address + in angle brackets with no name outside the brackets. + Revision 610.18 2003/09/21 04:10:56 ajc * messages.c: don't crash when a message contains more than MAXURLS of embedded URL's. Omit them instead. @@ -5037,3 +5041,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 50da22692..fd16a6f18 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -268,6 +268,14 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name) striplt(user); striplt(node); striplt(name); + + /* If we processed a string that had the address in angle brackets + * but no name outside the brackets, we now have an empty name. In + * this case, use the user portion of the address as the name. + */ + if ((strlen(name) == 0) && (strlen(user) > 0)) { + strcpy(name, user); + } } diff --git a/citadel/tools.c b/citadel/tools.c index d3610212a..0c7c31378 100644 --- a/citadel/tools.c +++ b/citadel/tools.c @@ -482,6 +482,10 @@ void stripout(char *str, char leftboundary, char rightboundary) { strcpy(&str[lb - 1], &str[rb + 1]); } + else if ( (lb == 0) && (rb > lb) ) { + strcpy(str, &str[rb + 1]); + } + } -- 2.39.2