Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/znc/znc into white_space_ed…

…ition
  • Loading branch information...
commit 43d0f6d121f3ac99a2df96b3886633c07d467ef9 2 parents d772985 + 4dbd088
@Un1matr1x Un1matr1x authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 modules/modpython/compiler.cpp
View
7 modules/modpython/compiler.cpp
@@ -7,6 +7,7 @@
*/
#include <Python.h>
+#include <string>
void fail(PyObject* py, int n) {
// Doesn't clear any variables, but meh, finalize anyway...
@@ -27,7 +28,11 @@ int main(int argc, char** argv) {
PyObject* pyFunc = PyObject_GetAttrString(pyModule, "compile");
fail(pyFunc, 2);
- PyObject* pyKW = Py_BuildValue("{sssN}", "cfile", argv[2], "doraise", Py_True);
+ std::string cfile = argv[2];
+ if (cfile.find('/') == std::string::npos) {
+ cfile = "./" + cfile;
+ }
+ PyObject* pyKW = Py_BuildValue("{sssN}", "cfile", cfile.c_str(), "doraise", Py_True);
fail(pyKW, 3);
PyObject* pyArg = Py_BuildValue("(s)", argv[1]);
Please sign in to comment.
Something went wrong with that request. Please try again.