***************************************************************************************
* DirToDest subroutine for DOpusFuncs.s						      *
***************************************************************************************
DirToDest
	Tst.l	DirToDest_S(a5)
	Bne.s	DirToDest_DoIt
	RTS
DirToDest_DoIt
	Sub.l	d0,d0			Abort if there isn't a source lister.
	Bsr	GetSourceHandle		Get the source lister's handle -> Source_Handle
	Moveq	#1,d0			Open new dest if one doesn't exist.
	Bsr	GetDestHandle		Get the dest lister's handle -> Dest_Handle
;-------------------------------------------------------------------------------------;
; Build full path of first selected directory in the source lister.		      ;
;-------------------------------------------------------------------------------------;
	Lea	Source_Handle(a5),a0	Handle to get the path of.
	Lea	Buffer1(a5),a1		Buffer to write path into.
	Move.w	#Buffer1Len,d7		Size of above buffer.
	Bsr	GetListerPath		Path -> buffer.

	Lea	Source_Handle(a5),a0
	Lea	DirName1Buffer(a5),a1	-._ Write directory name
	Move.w	#DirName1BufferLen,d7	-'  into second buffer.
	Bsr	GetFirstSelDir		First Selected Directory -> buffer.

;;;;;;;	Now to join the two halves of the full path together.

	Lea	Buffer1(a5),a0		Fist half, and buffer for joined string.
	Lea	DirName1Buffer(a5),a1	Second half of string.
	Move.w	#Buffer1Len,d7		Length of (a0) buffer.
	Bsr	Join_NT			Join the dirname to its path.
;;;;;;;	Buffer_Overflow handled automatically.
;-------------------------------------------------------------------------------------;
	Sub.l	d0,d0			Deselect...
	Lea	DirName1Buffer(a5),a1	...the dir-entry...
	Lea	Source_Handle(a5),a0	...from the source lister.
	Bsr	ListerSelect

	Sub.l	d0,d0			Normal refresh (not "full")
	Lea	Source_Handle(a5),a0	-._ Refresh the
	Bsr	ListerRefresh		-'  Source lister.
;-------------------------------------------------------------------------------------;
	Lea	Dest_Handle(a5),a0	Handle to read path into.
	Lea	Buffer1(a5),a1		Path to read.
	Sub.l	d0,d0			Don't force into current path buffer.
	Bra	ReadListerPath		Read the path into the destination lister.
;;;;;;;	RTS for us.
