/pidgin/main: 412e9e76b589: Merge
Andrew Victor
andrew.victor at mxit.com
Wed Jan 16 04:39:52 EST 2013
Changeset: 412e9e76b58937b0c31aa9b15779847c28f42956
Author: Andrew Victor <andrew.victor at mxit.com>
Date: 2013-01-15 11:34 +0200
Branch: mxit-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/412e9e76b589
Description:
Merge
diffstat:
ChangeLog | 3 +++
Makefile.am | 6 +++---
libpurple/log.c | 12 +++++-------
libpurple/plugins/log_reader.c | 3 +--
libpurple/plugins/tcl/signal-test.tcl | 2 +-
libpurple/plugins/tcl/tcl.c | 34 +++++++---------------------------
libpurple/stringref.c | 4 +++-
libpurple/upnp.c | 1 +
pidgin.spec.in | 2 +-
9 files changed, 25 insertions(+), 42 deletions(-)
diffs (216 lines):
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@ version 2.10.7:
(Bartosz Brachaczek) (#15329)
* Fix UPNP mappings on routers that return empty <URLBase/> elements
in their response. (Ferdinand Stehle) (#15373)
+ * Tcl plugin uses saner, race-free plugin loading.
+ * Fix the Tcl signals-test plugin for savedstatus-changed.
+ (Andrew Shadura) (#15443)
Pidgin:
* Make Pidgin more friendly to non-X11 GTK+, such as MacPorts' +no_x11
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,7 @@ EXTRA_DIST = \
HACKING \
Makefile.mingw \
PLUGIN_HOWTO \
- README.MTN \
+ README.hg \
README.mingw \
config.h.mingw \
doxy2devhelp.xsl \
@@ -56,13 +56,13 @@ version-check:
# ... and have no changes in the working copy. (this isn't really necessary with hg because hg id appends a "+")
test "x`hg st -mard`" = x
-packages:
+sign-packages: dist
gpg -ab pidgin-$(PACKAGE_VERSION).tar.gz
gpg -ab pidgin-$(PACKAGE_VERSION).tar.bz2
gpg --verify pidgin-$(PACKAGE_VERSION).tar.gz.asc pidgin-$(PACKAGE_VERSION).tar.gz
gpg --verify pidgin-$(PACKAGE_VERSION).tar.bz2.asc pidgin-$(PACKAGE_VERSION).tar.bz2
-release: commit-check version-check distcheck packages
+release: commit-check version-check distcheck sign-packages
if INSTALL_I18N
PO_DIR=po
diff --git a/libpurple/log.c b/libpurple/log.c
--- a/libpurple/log.c
+++ b/libpurple/log.c
@@ -1763,7 +1763,7 @@ static GList *old_logger_list(PurpleLogT
index_tmp = g_strdup_printf("%s.XXXXXX", pathstr);
if ((index_fd = g_mkstemp(index_tmp)) == -1) {
purple_debug_error("log", "Failed to open index temp file: %s\n",
- g_strerror(errno));
+ g_strerror(errno));
g_free(pathstr);
g_free(index_tmp);
index = NULL;
@@ -1771,7 +1771,7 @@ static GList *old_logger_list(PurpleLogT
if ((index = fdopen(index_fd, "wb")) == NULL)
{
purple_debug_error("log", "Failed to fdopen() index temp file: %s\n",
- g_strerror(errno));
+ g_strerror(errno));
close(index_fd);
if (index_tmp != NULL)
{
@@ -1827,7 +1827,6 @@ static GList *old_logger_list(PurpleLogT
log->logger_data = data;
list = g_list_prepend(list, log);
- /* XXX: There is apparently Is there a proper way to print a time_t? */
if (index != NULL)
fprintf(index, "%d\t%d\t%lu\n", data->offset, data->length, (unsigned long)log->time);
}
@@ -1887,9 +1886,8 @@ static GList *old_logger_list(PurpleLogT
log->logger_data = data;
list = g_list_prepend(list, log);
- /* XXX: Is there a proper way to print a time_t? */
if (index != NULL)
- fprintf(index, "%d\t%d\t%d\n", data->offset, data->length, (int)log->time);
+ fprintf(index, "%d\t%d\t%lu\n", data->offset, data->length, (unsigned long)log->time);
}
}
@@ -2022,7 +2020,7 @@ static void old_logger_get_log_sets(Purp
/* Search the buddy list to find the account and to determine if this is a buddy. */
for (gnode = purple_blist_get_root();
!found && gnode != NULL;
- gnode = purple_blist_node_get_sibling_next(gnode))
+ gnode = purple_blist_node_get_sibling_next(gnode))
{
if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
continue;
@@ -2036,7 +2034,7 @@ static void old_logger_get_log_sets(Purp
for (bnode = purple_blist_node_get_first_child(cnode);
!found && bnode != NULL;
- bnode = purple_blist_node_get_sibling_next(bnode))
+ bnode = purple_blist_node_get_sibling_next(bnode))
{
PurpleBuddy *buddy = (PurpleBuddy *)bnode;
diff --git a/libpurple/plugins/log_reader.c b/libpurple/plugins/log_reader.c
--- a/libpurple/plugins/log_reader.c
+++ b/libpurple/plugins/log_reader.c
@@ -921,7 +921,6 @@ static char * msn_logger_read (PurpleLog
xmlnode *to;
enum name_guesses name_guessed = NAME_GUESS_UNKNOWN;
const char *their_name;
- time_t time_unix;
struct tm *tm;
char *timestamp;
char *tmp;
@@ -1104,7 +1103,7 @@ static char * msn_logger_read (PurpleLog
text = g_string_append(text, ";\">");
}
- time_unix = msn_logger_parse_timestamp(message, &tm);
+ msn_logger_parse_timestamp(message, &tm);
timestamp = g_strdup_printf("<font size=\"2\">(%02u:%02u:%02u)</font> ",
tm->tm_hour, tm->tm_min, tm->tm_sec);
diff --git a/libpurple/plugins/tcl/signal-test.tcl b/libpurple/plugins/tcl/signal-test.tcl
--- a/libpurple/plugins/tcl/signal-test.tcl
+++ b/libpurple/plugins/tcl/signal-test.tcl
@@ -108,7 +108,7 @@ purple::signal connect [purple::plugins
purple::debug -info "tcl signal" "plugin-unload [list $args]"
}
-purple::signal connect [purple::savedstatuses handle] savedstatus-changed args {
+purple::signal connect [purple::savedstatus handle] savedstatus-changed args {
purple::debug -info "tcl signal" "savedstatus-changed [list $args]"
purple::debug -info "tcl signal" "purple::savedstatus current = [purple::savedstatus current]"
}
diff --git a/libpurple/plugins/tcl/tcl.c b/libpurple/plugins/tcl/tcl.c
--- a/libpurple/plugins/tcl/tcl.c
+++ b/libpurple/plugins/tcl/tcl.c
@@ -174,37 +174,17 @@ static gboolean tcl_probe_plugin(PurpleP
Tcl_Interp *interp;
Tcl_Parse parse;
Tcl_Obj *result, **listitems;
- struct stat st;
- FILE *fp;
- char *buf, *cur;
+ char *buf;
const char *next;
- int len, found = 0, err = 0, nelems;
+ int found = 0, err = 0, nelems;
+ gsize len;
gboolean status = FALSE;
- if ((fp = g_fopen(plugin->path, "r")) == NULL)
- return FALSE;
- if (fstat(fileno(fp), &st)) {
- fclose(fp);
+
+ if (!g_file_get_contents(plugin->path, &buf, &len, NULL)) {
+ purple_debug(PURPLE_DEBUG_INFO, "tcl", "Error opening plugin %s\n",
+ plugin->path);
return FALSE;
}
- len = st.st_size;
-
- buf = g_malloc(len + 1);
-
- cur = buf;
- while (fgets(cur, GPOINTER_TO_INT(buf) - (buf - cur), fp)) {
- cur += strlen(cur);
- if (feof(fp))
- break;
- }
-
- if (ferror(fp)) {
- purple_debug(PURPLE_DEBUG_ERROR, "tcl", "error reading %s (%s)\n", plugin->path, g_strerror(errno));
- g_free(buf);
- fclose(fp);
- return FALSE;
- }
-
- fclose(fp);
if ((interp = tcl_create_interp()) == NULL) {
return FALSE;
diff --git a/libpurple/stringref.c b/libpurple/stringref.c
--- a/libpurple/stringref.c
+++ b/libpurple/stringref.c
@@ -73,7 +73,9 @@ PurpleStringref *purple_stringref_new(co
len = strlen(value);
newref = g_malloc(sizeof(PurpleStringref) + len);
- g_strlcpy(newref->value, value, len);
+ /* g_strlcpy() takes the size of the buffer, including the NUL.
+ strlen() returns the length of the string, without the NUL. */
+ g_strlcpy(newref->value, value, len + 1);
newref->ref = 1;
return newref;
diff --git a/libpurple/upnp.c b/libpurple/upnp.c
--- a/libpurple/upnp.c
+++ b/libpurple/upnp.c
@@ -256,6 +256,7 @@ purple_upnp_parse_description_response(c
}
/* get the baseURL of the device */
+ baseURL = NULL;
if((baseURLNode = xmlnode_get_child(xmlRootNode, "URLBase")) != NULL) {
baseURL = xmlnode_get_data(baseURLNode);
}
diff --git a/pidgin.spec.in b/pidgin.spec.in
--- a/pidgin.spec.in
+++ b/pidgin.spec.in
@@ -368,7 +368,7 @@ fi
%doc ChangeLog
%doc NEWS
%doc README
-%doc README.MTN
+%doc README.hg
%doc doc/the_penguin.txt
%doc %{_mandir}/man1/pidgin.*
%doc %{_mandir}/man3*/*
More information about the Commits
mailing list