changeset 17522:fb096fc27b4e

Don't load the tcl loader plugin on Windows unless ActiveTcl 8.4.5 or newer is present. Fixes #538.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 06 Jun 2007 02:56:46 +0000
parents fa1102b7a959
children 05404736d5e3 4b4eb353cf9f eae7a411e3a1
files libpurple/plugins/tcl/tcl.c
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/tcl/tcl.c	Wed Jun 06 02:45:31 2007 +0000
+++ b/libpurple/plugins/tcl/tcl.c	Wed Jun 06 02:56:46 2007 +0000
@@ -457,11 +457,23 @@
 
 	if ((version = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey, "CurrentVersion"))
 			|| (version = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey, "CurrentVersion"))) {
-		char *path;
+		char *path = NULL;
 		char *regkey2;
+		char **tokens;
+		int major = 0, minor = 0, micro = 0;
+
+		tokens = g_strsplit(version, ".", 0);
+		if (tokens[0] && tokens[1] && tokens[2]) {
+			major = atoi(tokens[0]);
+			minor = atoi(tokens[1]);
+			micro = atoi(tokens[2]);
+		}
+		g_strfreev(tokens);
 
 		regkey2 = g_strdup_printf("%s%s\\", regkey, version);
-		if ((path = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey2, NULL)) || (path = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey2, NULL))) {
+		if (!(major == 8 && minor == 4 && micro >= 5))
+			purple_debug(PURPLE_DEBUG_INFO, "tcl", "Unsupported ActiveTCL version %s found.\n", version);
+		else if ((path = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey2, NULL)) || (path = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey2, NULL))) {
 			char *tclpath;
 			char *tkpath;