2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include "dos_intern.h"
11 /*****************************************************************************
14 #include <dos/dosasl.h>
15 #include <proto/dos.h>
17 AROS_LH1(void, MatchEnd
,
20 AROS_LHA(struct AnchorPath
*, AP
, D1
),
23 struct DosLibrary
*, DOSBase
, 139, Dos
)
26 Free the memory that was allocated by calls to MatchFirst() and
30 AP - pointer to Anchor Path structure which had been passed to
34 Allocated memory is returned and filelocks are freed.
46 *****************************************************************************/
49 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
51 struct AChain
*ac
= AP
->ap_Base
, *acnext
;
55 #if MATCHFUNCS_NO_DUPLOCK
57 ** CurrentDir to a valid lock, ie. one that will not be
58 ** killed further below
61 CurrentDir(ac
->an_Lock
);
66 acnext
= ac
->an_Child
;
69 ** Dont unlock lock in first AChain because it is the same
70 ** as the current directory when MatchFirst was called. And
71 ** this lock was not DupLock()ed (except MATCHFUNCS_NO_DUPLOCK == 0)!!!
75 #if MATCHFUNCS_NO_DUPLOCK
76 && (ac
!= AP
->ap_Base
)
82 Match_FreeAChain(ac
, DOSBase
);
88 AP
->ap_Current
= NULL
;