From f8e0a240329978d126c63db7d25895bec6a7e03a Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 15 Aug 2021 15:47:04 -0400 Subject: [PATCH] cwFileSys.cpp: Automatically expandPath() in dirEntries(). --- cwFileSys.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cwFileSys.cpp b/cwFileSys.cpp index 034c2af..5d5b8e8 100644 --- a/cwFileSys.cpp +++ b/cwFileSys.cpp @@ -713,19 +713,20 @@ namespace cw cw::filesys::dirEntry_t* cw::filesys::dirEntries( const char* dirStr, unsigned filterFlags, unsigned* dirEntryCntPtr ) { - rc_t rc = kOkRC; + rc_t rc = kOkRC; deRecd_t r; memset(&r,0,sizeof(r)); - //r.p = _cmFileSysHandleToPtr(h); r.filterFlags = filterFlags; cwAssert( dirEntryCntPtr != NULL ); *dirEntryCntPtr = 0; + + char* inDirStr = filesys::expandPath(dirStr); for(r.passIdx=0; r.passIdx<2; ++r.passIdx) { - if((rc = _dirGetEntries( &r, dirStr )) != kOkRC ) + if((rc = _dirGetEntries( &r, inDirStr )) != kOkRC ) goto errLabel; if( r.passIdx == 0 && r.dataByteCnt>0 ) @@ -757,6 +758,8 @@ cw::filesys::dirEntry_t* cw::filesys::dirEntries( const char* dirStr, unsigned f r.rp = NULL; } + mem::release(inDirStr); + return r.rp; }