summaryrefslogtreecommitdiff
path: root/xpcom/build/LateWriteChecks.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-05-09 22:38:16 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-09 22:38:16 +0000
commit9edf1b7bea5ff893f88911fc1a6a2dca3faeece9 (patch)
tree98bd9b0c7e3ca3e517e9e43dea157707b13f6bdb /xpcom/build/LateWriteChecks.cpp
parent930ddd693be251c86ee904dafbaef38234b692c0 (diff)
downloaduxp-9edf1b7bea5ff893f88911fc1a6a2dca3faeece9.tar.gz
Issue #1896 - Port GetNativePath changes from GRE.getnativepath-work
Diffstat (limited to 'xpcom/build/LateWriteChecks.cpp')
-rw-r--r--xpcom/build/LateWriteChecks.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/xpcom/build/LateWriteChecks.cpp b/xpcom/build/LateWriteChecks.cpp
index 7ace9a0fbd..218454c4d3 100644
--- a/xpcom/build/LateWriteChecks.cpp
+++ b/xpcom/build/LateWriteChecks.cpp
@@ -122,10 +122,17 @@ InitLateWriteChecks()
nsCOMPtr<nsIFile> mozFile;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mozFile));
if (mozFile) {
- nsAutoCString nativePath;
- nsresult rv = mozFile->GetNativePath(nativePath);
- if (NS_SUCCEEDED(rv) && nativePath.get()) {
- sLateWriteObserver = new LateWriteObserver(nativePath.get());
+ nsAutoCString writeObserverPath;
+#ifdef XP_WIN
+ nsAutoString U16Path;
+ nsresult rv = mozFile->GetPath(U16Path);
+ CopyUTF16toUTF8(U16Path, writeObserverPath);
+#else
+ // On non-Windows just get the native path.
+ nsresult rv = mozFile->GetNativePath(writeObserverPath);
+#endif
+ if (NS_SUCCEEDED(rv) && writeObserverPath.get()) {
+ sLateWriteObserver = new LateWriteObserver(writeObserverPath.get());
}
}
}