* Better handling of incoming Internet addresses consisting of an address
authorArt Cancro <ajc@citadel.org>
Tue, 7 Oct 2003 15:56:17 +0000 (15:56 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 7 Oct 2003 15:56:17 +0000 (15:56 +0000)
  in angle brackets with no name outside the brackets.

citadel/ChangeLog
citadel/internet_addressing.c
citadel/tools.c

index 56396150dbc6c2febdd1fd66e4780189570f1449..1183eee356b8fae81f0c9dabd2d751b39c4c405d 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 50da226926d6515b14c3ebc0855138fc31094cd3..fd16a6f1813e1bb1385b859be08d00c2e3690369 100644 (file)
@@ -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);
+       }
 }
 
 
index d3610212a04b040053802ae28a2cfd22e738692a..0c7c313783ec15aac96cdddfba39ae6340756471 100644 (file)
@@ -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]);
+        }
+
 }