changeset 1949:3397860c22e9

[gaim-migrate @ 1959] more gtk2 stuff. this doesn't actually fix anything though. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 01 Jun 2001 23:56:52 +0000
parents 30f7c8f9c6b9
children a69396ce5bab
files src/gaim.h src/perl.c src/util.c
diffstat 3 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaim.h	Fri Jun 01 23:48:29 2001 +0000
+++ b/src/gaim.h	Fri Jun 01 23:56:52 2001 +0000
@@ -627,7 +627,7 @@
 extern void show_usage (int, char *);
 extern void set_first_user (char *);
 extern int do_auto_login (char *);
-extern int file_is_dir (char *, GtkWidget *);
+extern int file_is_dir (const char *, GtkWidget *);
 extern char *gaim_user_dir();
 extern void strncpy_nohtml(gchar *, const gchar *, size_t);
 extern void strncpy_withhtml(gchar *, const gchar *, size_t);
--- a/src/perl.c	Fri Jun 01 23:48:29 2001 +0000
+++ b/src/perl.c	Fri Jun 01 23:56:52 2001 +0000
@@ -617,31 +617,29 @@
 }
 
 static void do_load(GtkWidget *m, gpointer n) {
-	const char *f = gtk_file_selection_get_filename(GTK_FILE_SELECTION(config));
-	gchar* file;
-	if (!f || !strlen(f)) {
+	const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(config));
+	gchar *f = NULL;
+	if (!file || !strlen(file)) {
 		perl_end();
 		perl_init();
 		return;
 	}
-	file = g_strdup(f);
 	
 	if (file_is_dir(file, config)) {
-		g_free(file);
 		return;
 	}
 	
 	if (last_dir) {
-		g_free(file);
 		g_free(last_dir);
 	}
 	last_dir = g_dirname(file);
 
 	debug_printf("Loading perl script: %s\n", file);
 	
-	perl_load_file(file);
+	f = g_strdup(file);
+	perl_load_file(f);
+	g_free(f);
 	cfdes(config, NULL);
-	g_free(file);
 }
 
 void load_perl_script(GtkWidget *w, gpointer d)
--- a/src/util.c	Fri Jun 01 23:48:29 2001 +0000
+++ b/src/util.c	Fri Jun 01 23:56:52 2001 +0000
@@ -1240,7 +1240,7 @@
 }
 
 
-int file_is_dir(char *path, GtkWidget *w)
+int file_is_dir(const char *path, GtkWidget *w)
 {
 	struct stat st;
 	char *name;