From be746a0b085b231785288fdf1e5fbaf0de4b82fd Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Thu, 2 May 2002 11:04:37 +0000 Subject: [PATCH] Some changes for nsIFile moving to nsACString. Not part of the build. git-svn-id: svn://10.0.0.236/trunk@120533 18797224-902f-48f8-a5cc-f745e15eee43 --- .../python/xpcom/src/loader/pyloader.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp b/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp index 63092e60cb6..ac5ba054884 100644 --- a/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp +++ b/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp @@ -13,7 +13,7 @@ * Portions created by ActiveState Tool Corp. are Copyright (C) 2000, 2001 * ActiveState Tool Corp. All Rights Reserved. * - * Contributor(s): Mark Hammond (original author) + * Contributor(s): Mark Hammond (original author) * */ @@ -32,7 +32,10 @@ #include "nsDirectoryServiceDefs.h" #include "nsILocalFile.h" #include "nsXPIDLString.h" - +#include "nsString.h" +#include "stdlib.h" +#include "stdarg.h" + #include // For console logging. #ifdef HAVE_LONG_LONG @@ -95,17 +98,18 @@ void AddStandardPaths() LogError("The Python XPCOM loader could not locate the 'bin' directory\n"); return; } - aFile->Append("python"); - nsXPIDLCString pathBuf; - aFile->GetPath(getter_Copies(pathBuf)); + nsCAutoString python(NS_LITERAL_CSTRING("python")); + aFile->Append(python); + nsCAutoString path_string; + aFile->GetPath(path_string); PyObject *obPath = PySys_GetObject("path"); if (!obPath) { LogError("The Python XPCOM loader could not get the Python sys.path variable\n"); return; } - LogDebug("The Python XPCOM loader is adding '%s' to sys.path\n", (const char *)pathBuf); + LogDebug("The Python XPCOM loader is adding '%s' to sys.path\n", (const char *)path_string.get()); // DebugBreak(); - PyObject *newStr = PyString_FromString(pathBuf); + PyObject *newStr = PyString_FromString(path_string.get()); PyList_Insert(obPath, 0, newStr); Py_XDECREF(newStr); }