summary refs log tree commit diff stats
path: root/xchat-wdk.patch
diff options
context:
space:
mode:
Diffstat (limited to 'xchat-wdk.patch')
-rw-r--r--xchat-wdk.patch43
1 files changed, 40 insertions, 3 deletions
diff --git a/xchat-wdk.patch b/xchat-wdk.patch
index 1290f622..ba495afa 100644
--- a/xchat-wdk.patch
+++ b/xchat-wdk.patch
@@ -38,12 +38,12 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/perl/perl.c xchat-wdk/plugi
  			}
 diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/python/python.c xchat-wdk/plugins/python/python.c
 --- xchat-wdk.orig/plugins/python/python.c	2010-05-16 06:31:54 +0200
-+++ xchat-wdk/plugins/python/python.c	2010-08-11 02:11:25 +0200
++++ xchat-wdk/plugins/python/python.c	2010-08-11 05:46:52 +0200
 @@ -51,12 +51,13 @@
   *
   */
  
-+#define  _INC_DIRENT
++//#define  _INC_DIRENT
  #include <glib.h>
  #include <string.h>
 -#include <unistd.h>
@@ -60,10 +60,47 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/python/python.c xchat-wdk/p
  #ifdef WIN32
  #undef WITH_THREAD /* Thread support locks up xchat on Win32. */
 -#define VERSION "0.8/2.4"	/* Linked to python24.dll */
-+#define VERSION "0.8/2.5"	/* Linked to python25.dll */
++#define VERSION "0.8/2.6"	/* Linked to python26.dll */
  #else
  #define VERSION "0.8"
  #endif
+@@ -1161,6 +1162,27 @@
+ 	PyObject_SetAttrString(m, "__version__", o);
+ 
+ 	if (filename) {
++#ifdef WIN32
++		/*	more info: 
++		 *	http://bytes.com/topic/python/answers/840542-pyrun_simplefile-crashes#post3364174
++		 *	http://effbot.org/pyfaq/pyrun-simplefile-crashes-on-windows-but-not-on-unix-why.htm
++		 */
++		PyObject* PyFileObject = PyFile_FromString(filename, "r");
++		if (PyFileObject == NULL) {
++			xchat_printf(ph, "Can't open file %s: %s\n",
++				     filename, strerror(errno));
++			goto error;
++		}
++
++		if (PyRun_SimpleFile(PyFile_AsFile(PyFileObject), filename) != 0) {
++			xchat_printf(ph, "Error loading module %s\n",
++				     filename);
++			goto error;
++		}
++
++		plugin->filename = filename;
++		filename = NULL;
++#else
+ 		FILE *fp;
+ 
+ 		plugin->filename = filename;
+@@ -1184,7 +1206,7 @@
+ 			goto error;
+ 		}
+ 		fclose(fp);
+-
++#endif
+ 		m = PyDict_GetItemString(PyImport_GetModuleDict(),
+ 					 "__main__");
+ 		if (m == NULL) {
 diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/tcl/tclplugin.c xchat-wdk/plugins/tcl/tclplugin.c
 --- xchat-wdk.orig/plugins/tcl/tclplugin.c	2010-03-21 01:49:42 +0100
 +++ xchat-wdk/plugins/tcl/tclplugin.c	2010-08-10 16:29:30 +0200