From c9d5c4e45cf239e76d6f2456adfcaedfd94db455 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 20 Jun 2016 21:14:17 +0900 Subject: [PATCH] mac: Convert path to absolute path in ShowItemInFolder --- atom/common/platform_util_mac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atom/common/platform_util_mac.mm b/atom/common/platform_util_mac.mm index 98bc4e537d89..d0146b11e085 100644 --- a/atom/common/platform_util_mac.mm +++ b/atom/common/platform_util_mac.mm @@ -8,6 +8,7 @@ #import #include "base/files/file_path.h" +#include "base/files/file_util.h" #include "base/logging.h" #include "base/mac/mac_logging.h" #include "base/mac/scoped_aedesc.h" @@ -17,7 +18,11 @@ namespace platform_util { -void ShowItemInFolder(const base::FilePath& full_path) { +void ShowItemInFolder(const base::FilePath& path) { + // The API only takes absolute path. + base::FilePath full_path = + path.IsAbsolute() ? path : base::MakeAbsoluteFilePath(path); + DCHECK([NSThread isMainThread]); NSString* path_string = base::SysUTF8ToNSString(full_path.value()); if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string