	SUBROUTINE FINPSR
C+
C	Title:	FINGERPSR.FTN
C	Author:	T. R. Wyant
C	Date:	02-Oct-1985
C	Modified:
C	Remarks:
C		This is the command parser for the RSX version of
C		FINGER.
C-

	INCLUDE 'FINGERCOM'
	INCLUDE 'IPCOMM'

C
C=======================================================================
C
C		Code.
C
C.......................................................................
C
C		Parse the command.
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Eliminate control chars, and convert to uppercase.
C
	IPSKFG = .FALSE.		! Blanks and tabs are syntax.
	CALL CMDCMP			! Compress the command.
3020	IF (IPANY() .AND.		! Skip past the command
     1	    IPMCH .NE. ' ')		!    name and
     2	    GO TO 3020			!    qualifiers.
	IPSKFG = .TRUE.			! Blanks and tabs are separators
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Check for ONE leading node name.
C
	NODEL = 0			! Assume no node name.
	IPLSAV = IPSLOC			! Save our position
	IPSSAV = IPSLEN			!    and buffer length.
	NODSPC = IPSLOC			! Location of (possible) nodname
	IF (.NOT. IPANUM(6)) GO TO 3490	! If not legal node name, quit.
	NODEA = IPLOC			! Get the nodename address.
	NODEL = IPLEN			! Get the nodename length.
	IF (.NOT. IPCHAR(':'))		! If no trailing colon,
     1	    GO TO 3490			!     can't be a real node name.
	IF (.NOT. IPCHAR(':'))		! We neet two, or it
     1	    GO TO 3490			!     can't be a real node name.
	GO TO 3600			! Go deal with node name.
3490	IPSLOC = IPLSAV			! Restore our position
	IPSLEN = IPSSAV			!    and length.
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Check for ONE trailing node name.
C
3510	NODEL = 0			! Assume no node name.
	NODSPC = IPSLOC			! Location of (possible) nodname
	IF (.NOT. IPANY()) GO TO 3590	! If none, go squish line.
	IF (IPMCH .NE. '@')		! If not the magic char.,
     1	    GO TO 3510			!     check for end of line.
	IF (.NOT. IPANUM(6)) GO TO 3510	! If not legal node name.
	NODEA = IPLOC			! Got a node name, save loc
	NODEL = IPLEN			!    and length.
	IF (.NOT. IPEOS()) GO TO 3510	! If not EOS, doesn't count.
	GO TO 3600			! Go handle the node name.
3590	IPSLOC = IPLSAV			! Restore our position
	IPSLEN = IPSSAV			!    and length.
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Copy out the node name.
C
3600	IF (NODEL .LE. 0) GO TO 3690	! If no node name, skip.
	CALL MOVSTR(NODEL,IPBUF(NODEA),	! Copy the node name into the
     1	    NODNAM)			!     designated cell.
	IF (IPSLEN .GT. 0)		! If we have more command,
     1	    CALL MOVSTR(IPSLEN,		!     compress it down over
     2	    IPBUF(IPSLOC),IPBUF(NODSPC)) !    the node name.
	IPSLOC = NODSPC + IPSLEN	! Point to the end of the buffer
	IPSLEN = 0			! No characters left.
3690	IPSLEN = IPSLOC + IPSLEN - 1	! Find length of remaining cmd.
	IPSLOC = 1			! It starts at position 1.
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Squish up the command.
C
3700	CALL IPR50(0)			! Gobble up the command name.
	IF (IPSLEN .GT. 0)		! If anything is left,
     1	    CALL MOVSTR(IPSLEN,		!    slide it up to make room
     2		IPBUF(IPSLOC),IPBUF(8))	!    for the literal.
	CALL MOVSTR(7,'FINGER ',IPBUF)	! Move the literal in.
	IPSLEN = IPSLEN + 7		! We have this many more chars,
	IPSLOC = 1			!    starting at location 1.
	CALL CMDCMP			! Re-compress the command.
C
C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C
C		Node name parse complete.
C
3900	RETURN
	END
