Bug 841011 - Use the parent directory of XRE_EXECUTABLE_FILE to find autoconf file. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 25 Feb 2013 10:50:12 +0100
changeset 133277 179a23a14368dfe49301c56ff32192824a079368
parent 133276 e81aef9e0d1637b6e787964d5cc2052597fe47f6
child 133278 cdc3588c8ce2d0258be11565b622b0410f2acf15
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs841011
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841011 - Use the parent directory of XRE_EXECUTABLE_FILE to find autoconf file. r=bsmedberg
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 {