From 030d286d2461c7ec9c785b4cb56b00d1e00ff7a1 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 29 Dec 2010 16:48:23 +0000 Subject: [PATCH] Only call ecore_file_file_get once. SVN revision: 55770 --- src/bin/e_widget_fsel.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/e_widget_fsel.c b/src/bin/e_widget_fsel.c index ab7994912..39e7b0276 100644 --- a/src/bin/e_widget_fsel.c +++ b/src/bin/e_widget_fsel.c @@ -67,7 +67,7 @@ static void _e_wid_fsel_favorites_add(void *data1, void *data2 __UNUSED__) { E_Widget_Data *wd; - const char *current_path; + const char *current_path, *fn; char buf[PATH_MAX], *fname; struct stat st; FILE *f; @@ -80,10 +80,12 @@ _e_wid_fsel_favorites_add(void *data1, void *data2 __UNUSED__) len = e_user_dir_snprintf(buf, sizeof(buf), "fileman/favorites/%s", ecore_file_file_get(current_path)); if (len >= sizeof(buf)) return; - if (stat(buf, &st) < 0) symlink(current_path, buf); + if (stat(buf, &st) < 0) + symlink(current_path, buf); else { unsigned int i = 1, maxlen; + buf[len] = '-'; len++; if (len == sizeof(buf)) return; @@ -97,8 +99,9 @@ _e_wid_fsel_favorites_add(void *data1, void *data2 __UNUSED__) while (stat(buf, &st) == 0); symlink(current_path, buf); } - fname = alloca(strlen(ecore_file_file_get(buf)) + 1); - strcpy(fname, ecore_file_file_get(buf)); + fn = ecore_file_file_get(buf); + fname = alloca(strlen(fn) + 1); + strcpy(fname, fn); e_user_dir_concat_static(buf, "fileman/favorites/.order"); if (ecore_file_exists(buf)) {