From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-AUG-1988 07:41
To:	ARISIA::EVERHART
Subj:	UW nntp remote news reader


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri, 12 AUG 88 12:53:27 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Fri, 12 Aug 88 12:11:15 PDT
Received: by ucbvax.Berkeley.EDU (5.59/1.30)
	id AA12769; Fri, 12 Aug 88 06:20:27 PDT
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 12 Aug 88 12:31:29 GMT
From: dogie!dorl%vms.macc.wisc.edu@csd1.milw.wisc.edu  (Michael Dorl - MACC)
Organization: University of Wisconsin Academic Computing Center
Subject: UW nntp remote news reader
Message-Id: <603@dogie.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

The following new version of function cmd_articlesamesubj replaces
the one found in news.for.  It contains changes so that articles
with subjects with and without leading 'Re:' are considered
equivalent.

---------------------------------------------------------------------
	Integer Function Cmd_ArticleSameSubj (G, A)

	Include 'News.Def'

C Parameter definition

	Integer   *4		G	! Group number
	Integer   *4		A	! Article number

C External routines

	Integer			Range_Find
	Integer			Cmd_ArticleFirst

C Local definitions

	Integer   *4		I
	Integer   *4		I_Lg
	Character *8		I_C
	Integer	  *4		Subject_Lg
	Integer   *4		Status
	Character *128		Subject
	Integer   *4		XSubject_Lg
	Character *128		XSubject

C Begin Cmd_ArticleSameSubj

C Send XHdg Subject command to retrieve subject line for article

	Call CacheHdr (G, A, Subject, Subject_Lg)

C Remove article number from front of subject line

	Call ItoS (A, I_C, I_Lg)
        I_Lg = I_Lg + 1

        If (I_Lg .lt. Subject_Lg) Then
	
	  Subject(1:Subject_Lg-I_Lg) = Subject(1+I_Lg:Subject_Lg)
	  Subject_Lg = Subject_Lg - I_Lg

C Remove Re: from subject line if present

	  If (Subject_Lg .ge. 5) Then
	    If (Subject(1:4) .eq. 'Re: ') Then
	      Subject(1:Subject_Lg-4) = Subject(5:Subject_Lg)
	      Subject_Lg = Subject_Lg - 4
	    EndIf
	  EndIf

C Display subject being looked for

	  Call SMG_All_Print
     $      ('Searching for: ' // Subject(1:Subject_Lg), '|')

C Page through articles looking for this subject

	  Do I = Group(G).Active_Start, Group(G).Active_End

	    If (Range_Find(G, I, .false.) .eq. 0) Then

	      Call CacheHdr (G, I, XSubject, XSubject_Lg)

C Remove article number from front of subject line

	      Call ItoS (I, I_C, I_Lg)
	      I_Lg = I_lg + 1

	      If (XSubject_Lg .gt. I_Lg) Then

	        XSubject(1:XSubject_Lg-I_Lg) = 
     $ 		  XSubject(1+I_Lg:XSubject_Lg)
	        XSubject_Lg = XSubject_Lg - I_Lg

C Remove Re: from front of subject line if present

		If (XSubject_Lg .ge. 5) Then
		  If (XSubject(1:4) .eq. 'Re: ') Then
		    XSubject(1:XSubject_Lg-4) = XSubject(5:XSubject_Lg)
		    XSubject_Lg = XSubject_Lg - 4
		  EndIf
		EndIf

C Compare subject lines

	        If 
     $		  (Subject(1:Subject_Lg) .eq. XSubject(1:XSubject_Lg))
     $	        Then
		  Cmd_ArticleSameSubj = .true.
		  A = I
		  Return
	        EndIf

	      EndIf ! (XSubject_Lg .gt. I_Lg)

	    EndIf ! (Range_Find(G, I, .false.) .eq. 0)

	  End Do

        EndIf ! (I_Lg .lt. Subject_Lg)

	Call SMG_All_Print ('No other articles found', '|')

	Cmd_ArticleSameSubj = Cmd_ArticleFirst (G,A)

	Return

	End ! Cmd_ArticleSameSubj 

---------------------------------------------------------------------
Michael Dorl (608) 262-0466
dorl@vms.macc.wisc.edu
dorl@wiscmacc.bitnet

