changeset 6925:3ec6aac0ff67

[gaim-migrate @ 7472] Don't free our string if it's the same one we're going to set. Oh yes, and modifying params in signal callbacks now works. The monkeys will be pleased. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 24 Sep 2003 01:06:56 +0000
parents d69bc8debac7
children 037051de314e
files plugins/perl/perl-handlers.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/perl/perl-handlers.c	Wed Sep 24 01:00:06 2003 +0000
+++ b/plugins/perl/perl-handlers.c	Wed Sep 24 01:06:56 2003 +0000
@@ -159,8 +159,12 @@
 					break;
 
 				case GAIM_TYPE_STRING:
-					g_free(*((char **)copy_args[i]));
-					*((char **)copy_args[i]) = g_strdup(SvPV(sv_args[i], na));
+					if (strcmp(*((char **)copy_args[i]), SvPVX(sv_args[i])))
+					{
+						g_free(*((char **)copy_args[i]));
+						*((char **)copy_args[i]) =
+							g_strdup(SvPV(sv_args[i], na));
+					}
 					break;
 
 				case GAIM_TYPE_POINTER: