[cvslog] Module eggdrop1.4: Change committed

cvslog cvs at tsss.iavalley.cc.ia.us
Thu Dec 21 14:05:01 CST 2000


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.4
Commit time: 2000-12-21 20:03:59 UTC

Modified files:
     doc/UPDATES1.4 src/patch.h src/proto.h src/tcl.c src/mod/module.h

Log message:

unicode support patch

---------------------- diff included ----------------------
Index: eggdrop1.4/doc/UPDATES1.4
diff -u eggdrop1.4/doc/UPDATES1.4:1.108 eggdrop1.4/doc/UPDATES1.4:1.109
--- eggdrop1.4/doc/UPDATES1.4:1.108	Fri Dec  1 14:46:20 2000
+++ eggdrop1.4/doc/UPDATES1.4	Thu Dec 21 14:03:49 2000
@@ -4,6 +4,9 @@
 
 1.4.6
 Foundby   Fixedby   What....
+          Fabian    Removed old high character hack from readtclprog, as the
+                    actual problem is now fixed.
+many      Wingman   Added proper support for tcl unicode changes since 8.1.
           dw        Do not set bans if they don't match someone in the channel
                     and the channel is set +dynamicbans.
           Eule      fixed crashes dealing with expired masks
Index: eggdrop1.4/src/mod/module.h
diff -u eggdrop1.4/src/mod/module.h:1.26 eggdrop1.4/src/mod/module.h:1.27
--- eggdrop1.4/src/mod/module.h:1.26	Tue May 23 16:06:16 2000
+++ eggdrop1.4/src/mod/module.h	Thu Dec 21 14:03:49 2000
@@ -1,7 +1,7 @@
 /* 
  * module.h
  * 
- * $Id: module.h,v 1.26 2000/05/23 21:06:16 guppy Exp $
+ * $Id: module.h,v 1.27 2000/12/21 20:03:49 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -253,8 +253,8 @@
 #define movefile ((int (*) (char *, char *))global[146])
 #define copyfile ((int (*) (char *, char *))global[147])
 /* 148 - 151 */
-#define do_tcl ((void (*)(char *,char*))global[148])
-#define readtclprog ((int (*)(char *))global[149])
+#define do_tcl ((void (*)(char *, char *))global[148])
+#define readtclprog ((int (*)(const char *))global[149])
 #define get_language ((char *(*)(int))global[150])
 #define def_get ((void *(*)(struct userrec *, struct user_entry *))global[151])
 /* 152 - 155 */
@@ -263,8 +263,8 @@
 #define maskhost ((void(*)(char *,char*))global[154])
 #define show_motd ((void(*)(int))global[155])
 /* 156 - 159 */
-#define tellhelp ((void(*)(int,char *,struct flag_record *,int))global[156])
-#define showhelp ((void(*)(char *,char *,struct flag_record *,int))global[157])
+#define tellhelp ((void(*)(int, char *, struct flag_record *, int))global[156])
+#define showhelp ((void(*)(char *, char *, struct flag_record *, int))global[157])
 #define add_help_reference ((void(*)(char *))global[158])
 #define rem_help_reference ((void(*)(char *))global[159])
 /* 160 - 163 */
Index: eggdrop1.4/src/patch.h
diff -u eggdrop1.4/src/patch.h:1.194 eggdrop1.4/src/patch.h:1.195
--- eggdrop1.4/src/patch.h:1.194	Fri Dec  1 14:46:20 2000
+++ eggdrop1.4/src/patch.h	Thu Dec 21 14:03:49 2000
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  * 
- * $Id: patch.h,v 1.194 2000/12/01 20:46:20 guppy Exp $
+ * $Id: patch.h,v 1.195 2000/12/21 20:03:49 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -40,11 +40,11 @@
 /*
  *
  */
-patch("975702857");	/* current unixtime */
+patch("977428866");	/* current unixtime */
 /*
  *
  */
-patch("dynban");
+patch("unicode_support");
 /*
  *
  */
Index: eggdrop1.4/src/proto.h
diff -u eggdrop1.4/src/proto.h:1.24 eggdrop1.4/src/proto.h:1.25
--- eggdrop1.4/src/proto.h:1.24	Sun May 28 21:29:09 2000
+++ eggdrop1.4/src/proto.h	Thu Dec 21 14:03:49 2000
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  * 
- * $Id: proto.h,v 1.24 2000/05/29 02:29:09 guppy Exp $
+ * $Id: proto.h,v 1.25 2000/12/21 20:03:49 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -243,7 +243,7 @@
 void protect_tcl();
 void unprotect_tcl();
 void do_tcl(char *, char *);
-int readtclprog(char *);
+int readtclprog(char *fname);
 int findidx(int);
 int findanyidx(int);
 
Index: eggdrop1.4/src/tcl.c
diff -u eggdrop1.4/src/tcl.c:1.29 eggdrop1.4/src/tcl.c:1.30
--- eggdrop1.4/src/tcl.c:1.29	Wed Aug  9 20:59:37 2000
+++ eggdrop1.4/src/tcl.c	Thu Dec 21 14:03:49 2000
@@ -6,7 +6,7 @@
  * 
  * dprintf'ized, 4feb1996
  * 
- * $Id: tcl.c,v 1.29 2000/08/10 01:59:37 guppy Exp $
+ * $Id: tcl.c,v 1.30 2000/12/21 20:03:49 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -495,6 +495,12 @@
   Tcl_InitMemory(interp);
 #endif
 
+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1
+  /* Set default encoding to default system encoding, i.e. binary.
+     Unicode support present since Tcl library version 8.1. */
+  Tcl_SetSystemEncoding(interp, NULL);
+#endif
+
   /* set Tcl variable tcl_interactive to 0 */
   Tcl_SetVar(interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
 
@@ -504,7 +510,6 @@
 
   /* add new commands */
   Tcl_CreateCommand(interp, "logfile", tcl_logfile, NULL, NULL);
-  /* isnt this much neater :) */
   add_tcl_commands(tcluser_cmds);
   add_tcl_commands(tcldcc_cmds);
   add_tcl_commands(tclmisc_cmds);
@@ -544,49 +549,20 @@
   }
 }
 
-/* Read the tcl file fname into memory and interpret it. Not using
- * Tcl_EvalFile avoids problems with high ascii characters.
+/* Interpret tcl file fname.
  *
  * returns:   1 - if everything was okay
  */
 int readtclprog(char *fname)
 {
-  int	 code;
-  long	 size;
-  char	*script;
   FILE	*f;
 
+  /* Check whether file is readable. */
   if ((f = fopen(fname, "r")) == NULL)
     return 0;
-
-  /* Find out file size. */
-  fseek(f, 0, SEEK_END);
-  size = ftell(f);
-  fseek(f, 0, SEEK_SET);
-
-  /* Allocate buffer to save the file's data in. */
-  if ((script = nmalloc(size + 1)) == NULL) {
-    fclose(f);
-    return 0;
-  }
-  script[size] = 0;
-
-  /* Read file's data to the allocated buffer. */
-  fread(script, 1, size, f);
   fclose(f);
 
-  if (debug_tcl) {
-    if ((f = fopen("DEBUG.TCL", "a")) != NULL)
-      fprintf(f, "*** eval: %s\n", script);
-  }
-  code = Tcl_Eval(interp, script);
-  nfree(script);
-  if (debug_tcl && f) {
-    fprintf(f, "*** done eval, result=%d\n", code);
-    fclose(f);
-  }
-
-  if (code != TCL_OK) {
+  if (Tcl_EvalFile(interp, fname) != TCL_OK) {
     putlog(LOG_MISC, "*", "Tcl error in file '%s':", fname);
     putlog(LOG_MISC, "*", "%s",
 	   Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY));
----------------------- End of diff -----------------------



More information about the Changes mailing list