include	clib.inc
include	dos.inc
include	string.inc
include	fblk.inc

PPROC	fballocff, ffblk:dword, flag:word
	les	bx,ffblk
	mov	ch,0
	mov	cl,es:[bx].ff_attrib
	or	cx,flag
	invoke	fballoc, addr es:[bx].ff_name,
		es:[bx].ff_ftime, es:[bx].ff_fdate, es:[bx].ff_fsize, cx
	jz	fballocff_end
	cmp	word ptr es:[bx].fb_name,'..'
	jne	@F
	cmp	es:[bx].fb_name[2],0
	jne	@F
	or	es:[bx].fb_flag,_A_UPDIR
      @@:
	test	cl,_A_SUBDIR
	jnz	fballocff_end
	add	ax,fb_name
	test	cl,_A_SYSTEM or _A_HIDDEN
	jz	@F
	inc	ax
      @@:
	invoke	strlwr,dx::ax
	mov	ax,bx
    fballocff_end:
	ret
PEND	fballocff

	END
