Change-Id: I515a6c5946ffd0dbc597af4a73105057c3fb5488
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
, __pCurDirEntry(null)
{
__validAccess = true;
, __pCurDirEntry(null)
{
__validAccess = true;
- __absoluteDirPath = dirPath;
}
_DirEnumeratorImpl::_DirEnumeratorImpl(const _DirEnumeratorImpl& dirEnumeratorImpl)
}
_DirEnumeratorImpl::_DirEnumeratorImpl(const _DirEnumeratorImpl& dirEnumeratorImpl)
{
SysTryReturnResult(NID_IO, __validAccess == true, E_ILLEGAL_ACCESS,
"Given path cannot be accessed!");
{
SysTryReturnResult(NID_IO, __validAccess == true, E_ILLEGAL_ACCESS,
"Given path cannot be accessed!");
- SysTryReturnResult(NID_IO, __absoluteDirPath.GetLength() > 0 && __absoluteDirPath.GetLength() <= PATH_MAX,
+ SysTryReturnResult(NID_IO, __dirPath.GetLength() > 0 && __dirPath.GetLength() <= PATH_MAX,
E_INVALID_ARG, "Invalid argument was passed. Given pattern length is not correct!");
result r = E_SUCCESS;
E_INVALID_ARG, "Invalid argument was passed. Given pattern length is not correct!");
result r = E_SUCCESS;
- unique_ptr<char[]> pDirPath(_StringConverter::CopyToCharArrayN(String(__absoluteDirPath)));
+ unique_ptr<char[]> pDirPath(_StringConverter::CopyToCharArrayN(String(__dirPath)));
SysTryReturn(NID_IO, pDirPath != null, GetLastResult(), GetLastResult(),
"[%s] Invalid argument was passed. Given pattern length is not correct!", GetErrorMessage(GetLastResult()));
SysTryReturn(NID_IO, pDirPath != null, GetLastResult(), GetLastResult(),
"[%s] Invalid argument was passed. Given pattern length is not correct!", GetErrorMessage(GetLastResult()));
memset(pEntryPath.get(), 0, len);
strcpy(pEntryPath.get(), pDirPath.get());
memset(pEntryPath.get(), 0, len);
strcpy(pEntryPath.get(), pDirPath.get());
- strncat(pEntryPath.get(), "/", 1);
+ if (__dirPath.EndsWith(L"/") == false)
+ {
+ strncat(pEntryPath.get(), "/", 1);
+ }
strncat(pEntryPath.get(), pDirEnt->d_name, strlen(pDirEnt->d_name));
struct stat64 statbuf;
strncat(pEntryPath.get(), pDirEnt->d_name, strlen(pDirEnt->d_name));
struct stat64 statbuf;
closedir(static_cast <DIR*>(__pFileFindInfo));
}
closedir(static_cast <DIR*>(__pFileFindInfo));
}
- unique_ptr<char[]> pDirPathName(_StringConverter::CopyToCharArrayN(__absoluteDirPath));
+ unique_ptr<char[]> pDirPathName(_StringConverter::CopyToCharArrayN(__dirPath));
SysTryReturn(NID_IO, pDirPathName != null, GetLastResult(), GetLastResult(),
"[%s] Failed to close file.", GetErrorMessage(GetLastResult()));
SysTryReturn(NID_IO, pDirPathName != null, GetLastResult(), GetLastResult(),
"[%s] Failed to close file.", GetErrorMessage(GetLastResult()));
_DirEnumeratorImpl& operator =(const _DirEnumeratorImpl& source);
bool __validAccess;
_DirEnumeratorImpl& operator =(const _DirEnumeratorImpl& source);
bool __validAccess;
- Tizen::Base::String __absoluteDirPath;
+ Tizen::Base::String __dirPath;
void* __pFileFindInfo;
DirEntry* __pCurDirEntry;
void* __pFileFindInfo;
DirEntry* __pCurDirEntry;