fix: normalize path before calling showItemInFolder and openPath (#41671)

* fix: normalize path before calling ShowItemInFolder

Co-authored-by: piotrpdev <piotrpdev@gmail.com>

* fix: normalize path before calling OpenPath

Co-authored-by: piotrpdev <piotrpdev@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: piotrpdev <piotrpdev@gmail.com>
This commit is contained in:
trop[bot] 2024-03-24 20:39:28 +01:00 committed by GitHub
parent 0f1e52fafe
commit 9ef3902841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,7 +336,8 @@ void ShowItemInFolder(const base::FilePath& full_path) {
base::ThreadPool::CreateCOMSTATaskRunner(
{base::MayBlock(), base::TaskPriority::USER_BLOCKING})
->PostTask(FROM_HERE,
base::BindOnce(&ShowItemInFolderOnWorkerThread, full_path));
base::BindOnce(&ShowItemInFolderOnWorkerThread,
full_path.NormalizePathSeparators()));
}
void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
@ -344,8 +345,10 @@ void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
base::ThreadPool::CreateCOMSTATaskRunner(
{base::MayBlock(), base::TaskPriority::USER_BLOCKING})
->PostTaskAndReplyWithResult(FROM_HERE,
base::BindOnce(&OpenPathOnThread, full_path),
->PostTaskAndReplyWithResult(
FROM_HERE,
base::BindOnce(&OpenPathOnThread,
full_path.NormalizePathSeparators()),
std::move(callback));
}