nsCString->nsString API changes. Merged from 1.0 branch.

Not part of the build.


git-svn-id: svn://10.0.0.236/trunk@122011 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2002-05-22 05:41:04 +00:00
parent d50114319b
commit e191ed4bda
2 changed files with 9 additions and 8 deletions

View File

@@ -31,6 +31,7 @@
#include "nsIModule.h"
#include "nsDirectoryServiceDefs.h"
#include "nsILocalFile.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsString.h"
#include "stdlib.h"
@@ -81,17 +82,17 @@ void AddStandardPaths()
LogError("The Python XPCOM loader could not locate the 'bin' directory\n");
return;
}
nsCAutoString python(NS_LITERAL_CSTRING("python"));
aFile->Append(python);
nsCAutoString path_string;
aFile->GetPath(path_string);
aFile->Append(NS_LITERAL_STRING("python"));
nsAutoString pathBuf;
aFile->GetPath(pathBuf);
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 *)path_string.get());
PyObject *newStr = PyString_FromString(path_string.get());
NS_LossyConvertUCS2toASCII pathCBuf(pathBuf);
LogDebug("The Python XPCOM loader is adding '%s' to sys.path\n", pathCBuf.get());
PyObject *newStr = PyString_FromString(pathCBuf.get());
PyList_Insert(obPath, 0, newStr);
Py_XDECREF(newStr);
}