C+
C NAME:
C	iParentFragment
C PURPOSE:
C	Deconstruct file names into components
C CALLING SEQUENCE:
	function iParentFragment(cDir,cOut)	! cDir = [........]
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*(*)

	iParentFragment = 0

	i2 = itrim(cDir)
	if (i2 .le. iLead+iTrail) then		! Don't change this !!!!!
	    cOut = cNoWhere
	    iParentFragment = iNoWhere

	else if (cDir(:i2) .eq. cFullRoot) then
	    cOut = cNoWhere
	    iParentFragment = iNoWhere

	else
	    i1 = iLead
	    i2 = i2-iTrail
	    i2 = i1+LocLast(cDivide,cDir(i1+1:i2))

	    if (i2-1 .lt. i1) then	! Invalid syntax??
		cOut = cNoWhere
		iParentFragment = iNoWhere

	    else if (i2-1 .eq. i1) then
		cOut = cRoot
		iParentFragment = iRoot

	    else
		cOut = cDir(i1+1:i2-1)
		iParentFragment = i2-1-i1

	    end if

	end if

	return
	end
