Browse Source

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

* fix: normalize path before calling ShowItemInFolder

Co-authored-by: piotrpdev <[email protected]>

* fix: normalize path before calling OpenPath

Co-authored-by: piotrpdev <[email protected]>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: piotrpdev <[email protected]>
trop[bot] 1 year ago
parent
commit
9ef3902841
1 changed files with 7 additions and 4 deletions
  1. 7 4
      shell/common/platform_util_win.cc

+ 7 - 4
shell/common/platform_util_win.cc

@@ -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,9 +345,11 @@ 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),
-                                   std::move(callback));
+      ->PostTaskAndReplyWithResult(
+          FROM_HERE,
+          base::BindOnce(&OpenPathOnThread,
+                         full_path.NormalizePathSeparators()),
+          std::move(callback));
 }
 
 void OpenExternal(const GURL& url,