Bug 841011 - Use the parent directory of XRE_EXECUTABLE_FILE to find autoconf file. r=bsmedberg, a=bajaj
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 25 Feb 2013 10:50:12 +0100
changeset 133038 c15b6ac9ec656f10e8a8562ac18cf6b0e1a458e0
parent 133037 954fbeed220cefe3b194f81277b7fe137f5f3867
child 133039 e162659d1a9335054f4a4a4a842fe2726b925423
push id317
push userbbajaj@mozilla.com
push dateTue, 07 May 2013 01:20:33 +0000
treeherdermozilla-release@159a10910249 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, bajaj
bugs841011
milestone21.0a2
Bug 841011 - Use the parent directory of XRE_EXECUTABLE_FILE to find autoconf file. r=bsmedberg, a=bajaj
extensions/pref/autoconfig/src/nsReadConfig.cpp
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -22,16 +22,17 @@
 #include "nsIStringBundle.h"
 #include "nsToolkitCompsCID.h"
 #include "nsXPIDLString.h"
 #include "nsNetUtil.h"
 #include "prmem.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "nspr.h"
+#include "nsXULAppAPI.h"
 
 extern PRLogModuleInfo *MCD;
 
 extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
                                           const char *filename, 
                                           bool bGlobalContext, 
                                           bool bCallbacks, 
                                           bool skipFirstLine);
@@ -237,22 +238,22 @@ nsresult nsReadConfig::openAndEvaluateJS
                                              bool isEncoded,
                                              bool isBinDir)
 {
     nsresult rv;
 
     nsCOMPtr<nsIInputStream> inStr;
     if (isBinDir) {
         nsCOMPtr<nsIFile> jsFile;
-        rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, 
+        rv = NS_GetSpecialDirectory(XRE_EXECUTABLE_FILE,
                                     getter_AddRefs(jsFile));
         if (NS_FAILED(rv)) 
             return rv;
 
-        rv = jsFile->AppendNative(nsDependentCString(aFileName));
+        rv = jsFile->SetNativeLeafName(nsDependentCString(aFileName));
         if (NS_FAILED(rv)) 
             return rv;
 
         rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
         if (NS_FAILED(rv)) 
             return rv;
 
     } else {