[news.software.b] readnews/vnews reply breaks on <address>

chip@vector.Dallas.TX.US (Chip Rosenthal) (08/26/89)

One comp.dcom.telecom reader informed me that vnews was having problems
replying to some messages.  Turns out, that it would choke on addresses
of the format:

	Reply-To: Mark Horton <mark@cbosgd.ATT.COM>

The RFC lists this as one of the three acceptable formats.  Unfortunately,
this wasn't supported in replyname().  This problem also affects readnews,
since they share the same code.  Fix is below.

Index: funcs2.c
*** funcs2.c~	Fri Mar 24 00:17:08 1989
--- funcs2.c	Fri Aug 25 21:53:09 1989
***************
*** 12,17 ****
--- 12,19 ----
   * this software for any use whatsoever, and it is provided as is. 
   * Any use of this software is at the user's own risk.
   *
+  * Fri Aug 25 21:50:03 1989 - Chip Rosenthal <chip@vector.Dallas.TX.US>
+  *	Fixed replyname() to understand addresses in angle brackets.
   *
   * funcs2 - functions used by both inews and readnews.
   */
***************
*** 335,341 ****
  replyname(hptr)
  struct hbuf *hptr;
  {
! 	register char *ptr;
  	static char tbuf[PATHLEN];
  
  	ptr = hptr->path;
--- 337,343 ----
  replyname(hptr)
  struct hbuf *hptr;
  {
! 	register char *ptr, *s;
  	static char tbuf[PATHLEN];
  
  	ptr = hptr->path;
***************
*** 351,357 ****
  	if (hptr->replyto[0] && !index(hptr->replyto, '@'))
  		ptr = hptr->replyto;
  #endif	/* !INTERNET */
! 	strcpy(tbuf, ptr);
  	ptr = index(tbuf, '(');
  	if (ptr) {
  		while (ptr[-1] == ' ')
--- 353,365 ----
  	if (hptr->replyto[0] && !index(hptr->replyto, '@'))
  		ptr = hptr->replyto;
  #endif	/* !INTERNET */
! 	if ( ( s = index(ptr,'<') ) != NULL ) {
! 	    strcpy(tbuf, s+1);
! 	    if ( ( ptr = index(tbuf,'>') ) != NULL )
! 		*ptr = '\0';
! 	} else {
! 	    strcpy(tbuf, ptr);
! 	}
  	ptr = index(tbuf, '(');
  	if (ptr) {
  		while (ptr[-1] == ' ')

-- 
Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337
"I wish you'd put that starvation box down and go to bed" - Albert Collins' Mom