[eggheads-patches] PATCH: tcl_pkgprovide-versionfix.diff

Tothwolf tothwolf at concentric.net
Mon Oct 4 15:14:43 CST 1999


tcl_pkgprovide-versionfix.diff - fixes the way we get get version number
                                 for Tcl_PkgProvide()
-------------- next part --------------
Index: doc/UPDATES1.3
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/doc/UPDATES1.3,v
retrieving revision 1.167
diff -u -r1.167 UPDATES1.3
--- doc/UPDATES1.3	1999/10/02 22:31:10	1.167
+++ doc/UPDATES1.3	1999/10/04 02:49:56
@@ -4,6 +4,8 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          Tothwolf/ fixed way we get version number for Tcl_PkgProvide()
+          ^PRS4^
           dw        it said 'JOIN flood from @%s!  Banning.'
                     for nick floods.
 reddawg   rtc       md5 make could fail on some OS
Index: src/tcl.c
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/tcl.c,v
retrieving revision 1.13
diff -u -r1.13 tcl.c
--- src/tcl.c	1999/09/27 20:33:55	1.13
+++ src/tcl.c	1999/10/04 02:50:09
@@ -462,7 +462,8 @@
  * smoking?!) so we gotta initialize the Tcl interpreter */
 void init_tcl()
 {
-  char pver[1024];
+  int i;
+  char pver[1024] = "";
 
   /* initialize the interpreter */
   context;
@@ -478,7 +479,11 @@
 
 #define Q(A,B) Tcl_CreateCommand(interp,A,B,NULL,NULL)
   Q("logfile", tcl_logfile);
-  sscanf(egg_version, "%s", pver);
+  for (i = 0; i <= strlen(egg_version); i++) {
+    if ((egg_version[i] == ' ') || (egg_version[i] == '+'))
+      break;
+    pver[strlen(pver)] = egg_version[i];
+  }
   Tcl_PkgProvide(interp, "eggdrop", pver);
 }
 


More information about the Patches mailing list