mdbx: устранение MDBX_EINVAL в случае mdbx_env_remove(".") (backport).

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-03-31 14:20:21 +03:00
parent 41ebd6dcf3
commit 2d2cec094e

View File

@ -14865,7 +14865,10 @@ __cold int mdbx_env_deleteW(const wchar_t *pathname,
err = MDBX_SUCCESS;
}
if (err == MDBX_SUCCESS && !(dummy_env->me_flags & MDBX_NOSUBDIR)) {
if (err == MDBX_SUCCESS && !(dummy_env->me_flags & MDBX_NOSUBDIR) &&
(/* pathname != "." */ pathname[0] != '.' || pathname[1] != 0) &&
(/* pathname != ".." */ pathname[0] != '.' || pathname[1] != '.' ||
pathname[2] != 0)) {
err = osal_removedirectory(pathname);
if (err == MDBX_SUCCESS)
rc = MDBX_SUCCESS;