Mercurial > pidgin
comparison libpurple/plugins/tcl/tcl.c @ 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 | 98b4e313b9ba |
children | 44b4e8bd759b |
comparison
equal
deleted
inserted
replaced
17521:fa1102b7a959 | 17522:fb096fc27b4e |
---|---|
455 char *version = NULL; | 455 char *version = NULL; |
456 gboolean retval = FALSE; | 456 gboolean retval = FALSE; |
457 | 457 |
458 if ((version = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey, "CurrentVersion")) | 458 if ((version = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey, "CurrentVersion")) |
459 || (version = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey, "CurrentVersion"))) { | 459 || (version = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey, "CurrentVersion"))) { |
460 char *path; | 460 char *path = NULL; |
461 char *regkey2; | 461 char *regkey2; |
462 char **tokens; | |
463 int major = 0, minor = 0, micro = 0; | |
464 | |
465 tokens = g_strsplit(version, ".", 0); | |
466 if (tokens[0] && tokens[1] && tokens[2]) { | |
467 major = atoi(tokens[0]); | |
468 minor = atoi(tokens[1]); | |
469 micro = atoi(tokens[2]); | |
470 } | |
471 g_strfreev(tokens); | |
462 | 472 |
463 regkey2 = g_strdup_printf("%s%s\\", regkey, version); | 473 regkey2 = g_strdup_printf("%s%s\\", regkey, version); |
464 if ((path = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey2, NULL)) || (path = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey2, NULL))) { | 474 if (!(major == 8 && minor == 4 && micro >= 5)) |
475 purple_debug(PURPLE_DEBUG_INFO, "tcl", "Unsupported ActiveTCL version %s found.\n", version); | |
476 else if ((path = wpurple_read_reg_string(HKEY_LOCAL_MACHINE, regkey2, NULL)) || (path = wpurple_read_reg_string(HKEY_CURRENT_USER, regkey2, NULL))) { | |
465 char *tclpath; | 477 char *tclpath; |
466 char *tkpath; | 478 char *tkpath; |
467 | 479 |
468 purple_debug(PURPLE_DEBUG_INFO, "tcl", "Loading ActiveTCL version %s from \"%s\"\n", version, path); | 480 purple_debug(PURPLE_DEBUG_INFO, "tcl", "Loading ActiveTCL version %s from \"%s\"\n", version, path); |
469 | 481 |