# HG changeset patch # User Richard Laager # Date 1177348003 0 # Node ID d13f39e181603ccffa5b1445c2f8127342cbd987 # Parent 6a9ae99e7050ddaf7219e705f4234a9781722f4a There's no need to recalculate the home_dir on every call to purple_user_dir() when we are already storing it in a variable anyway. diff -r 6a9ae99e7050 -r d13f39e18160 libpurple/util.c --- a/libpurple/util.c Mon Apr 23 17:05:54 2007 +0000 +++ b/libpurple/util.c Mon Apr 23 17:06:43 2007 +0000 @@ -65,7 +65,7 @@ }; static char custom_home_dir[MAXPATHLEN]; -static char home_dir[MAXPATHLEN]; +static char home_dir[MAXPATHLEN] = ""; PurpleMenuAction * purple_menu_action_new(const char *label, PurpleCallback callback, gpointer data, @@ -2251,7 +2251,7 @@ { if (custom_home_dir != NULL && *custom_home_dir) { strcpy ((char*) &home_dir, (char*) &custom_home_dir); - } else { + } else if (!*home_dir) { const gchar *hd = purple_home_dir(); if (hd) {