C+
C NAME:
C	iLastFragment
C PURPOSE:
C	Deconstruct file names into components
C CALLING SEQUENCE:
	function iLastFragment(cDir,cOut)
C INPUTS:
C OUTPUTS:
C CALLS:
C	LocLast, itrim
C INCLUDE:
	include		'dirspec.h'
C PROCEDURE:
C MODIFICATION HISTORY:
C	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
C-
	    character	cDir*(*)
	    character	cOut*(*)

	iLastFragment = 0

	i2 = itrim(cDir)
	if (i2 .le. iLead+iTrail) then
	    cOut = ' '
	    return
	end if

	i1 = iLead
	i2 = i2-iTrail
		! Implicitly assumes iDivide = 1 (if LocLast returns 0)
	i1 = i1+LocLast(cDivide,cDir(i1+1:i2))+iDivide

	cOut = cDir(i1:i2)
	iLastFragment = i2-i1+1

	return
	end
