Code: Select all
patch -p1 <eggdr.patch
patching file src/main.h
patching file src/tcl.c
Hunk #1 FAILED at 650.
1 out of 1 hunk FAILED -- saving rejects to file src/tcl.c.rej
Code: Select all
***************
*** 650,656 ****
if (encoding == NULL) {
encoding = "iso8859-1";
}
-
Tcl_SetSystemEncoding(NULL, encoding);
--- 650,656 ----
if (encoding == NULL) {
encoding = "iso8859-1";
}
+ encoding = "utf-8";
Tcl_SetSystemEncoding(NULL, encoding);
Code: Select all
diff -urN eggdrop1.6.19.original/src/chanprog.c eggdrop1.6.19.modified/src/chanprog.c
--- eggdrop1.6.19.original/src/chanprog.c 2008-02-16 22:41:03.000000000 +0100
+++ eggdrop1.6.19.modified/src/chanprog.c 2010-06-21 14:24:27.000000000 +0200
@@ -444,7 +444,7 @@
protect_readonly = 0;
/* Now read it */
- if (!readtclprog(configfile))
+ if (!readtclprog(configfile, 0))
fatal(MISC_NOCONFIGFILE, 0);
for (i = 0; i < max_logs; i++) {
diff -urN eggdrop1.6.19.original/src/mod/channels.mod/channels.c eggdrop1.6.19.modified/src/mod/channels.mod/channels.c
--- eggdrop1.6.19.original/src/mod/channels.mod/channels.c 2008-02-16 22:41:06.000000000 +0100
+++ eggdrop1.6.19.modified/src/mod/channels.mod/channels.c 2010-06-21 14:24:27.000000000 +0200
@@ -498,7 +498,7 @@
if (!channel_static(chan))
chan->status |= CHAN_FLAGGED;
chan_hack = 1;
- if (!readtclprog(chanfile) && create) {
+ if (!readtclprog(chanfile, 1) && create) {
FILE *f;
/* Assume file isnt there & therfore make it */
diff -urN eggdrop1.6.19.original/src/mod/module.h eggdrop1.6.19.modified/src/mod/module.h
--- eggdrop1.6.19.original/src/mod/module.h 2008-02-16 22:41:06.000000000 +0100
+++ eggdrop1.6.19.modified/src/mod/module.h 2010-06-21 14:29:54.000000000 +0200
@@ -282,7 +282,7 @@
#define copyfile ((int (*) (char *, char *))global[147])
/* 148 - 151 */
#define do_tcl ((void (*)(char *, char *))global[148])
-#define readtclprog ((int (*)(const char *))global[149])
+#define readtclprog ((int (*)(const char *, int))global[149])
#define get_language ((char *(*)(int))global[150])
#define def_get ((void *(*)(struct userrec *, struct user_entry *))global[151])
/* 152 - 155 */
diff -urN eggdrop1.6.19.original/src/proto.h eggdrop1.6.19.modified/src/proto.h
--- eggdrop1.6.19.original/src/proto.h 2008-02-16 22:41:04.000000000 +0100
+++ eggdrop1.6.19.modified/src/proto.h 2010-06-21 14:30:06.000000000 +0200
@@ -270,7 +270,7 @@
void protect_tcl();
void unprotect_tcl();
void do_tcl(char *, char *);
-int readtclprog(char *fname);
+int readtclprog(char *fname, int);
/* userent.c */
void list_type_kill(struct list_type *);
diff -urN eggdrop1.6.19.original/src/tcl.c eggdrop1.6.19.modified/src/tcl.c
--- eggdrop1.6.19.original/src/tcl.c 2008-02-16 22:41:04.000000000 +0100
+++ eggdrop1.6.19.modified/src/tcl.c 2010-06-21 14:26:57.000000000 +0200
@@ -725,21 +725,34 @@
*
* returns: 1 - if everything was okay
*/
-int readtclprog(char *fname)
+int readtclprog(char *fname, int noencoding)
{
int code;
char *result;
#ifdef USE_TCL_ENCODING
+ char *encoding = NULL;
Tcl_DString dstr;
#endif
if (!file_readable(fname))
return 0;
+#ifdef USE_TCL_ENCODING
+ if (noencoding && Tcl_Eval(interp, "encoding system") == TCL_OK) {
+ encoding = nmalloc(strlen(interp->result)+1);
+ strcpy(encoding, interp->result);
+ Tcl_SetSystemEncoding(interp, "identity");
+ }
+#endif
+
code = Tcl_EvalFile(interp, fname);
result = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
#ifdef USE_TCL_ENCODING
+ if (noencoding && encoding) {
+ Tcl_SetSystemEncoding(interp, encoding);
+ nfree(encoding);
+ }
/* properly convert string to system encoding. */
Tcl_DStringInit(&dstr);
Tcl_UtfToExternalDString(NULL, result, -1, &dstr);