	subroutine fixfnam(fnam)
	character*80 fnam,prefix
	np=index(fnam,'/')-1
	if(np.le.0) return
	call getenv(fnam(1:np),prefix)
c	write(6,101) fnam(1:np),prefix
101	format(10x,a)
	n1=notbnk(prefix,80)
	n2=notbnk(fnam,80)
	if(n1+n2-np.gt.80) then
	write(6,11) prefix,fnam
11	format(/10x,'file name is too long'/10x,a/10x,a)
	stop
	endif
	fnam=prefix(1:n1)//fnam(np+1:n2)
	return
	end
