summaryrefslogtreecommitdiff
path: root/ui/recent.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/recent.c')
-rw-r--r--ui/recent.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/ui/recent.c b/ui/recent.c
index 2633ac92cf..82666ffff2 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -1208,7 +1208,7 @@ recent_set_arg(char *prefarg)
/* opens the user's recent common file and read the first part */
-void
+gboolean
recent_read_static(char **rf_path_return, int *rf_errno_return)
{
char *rf_path;
@@ -1241,8 +1241,6 @@ recent_read_static(char **rf_path_return, int *rf_errno_return)
read_prefs_file(rf_path, rf, read_set_recent_common_pair_static, NULL);
fclose(rf);
- g_free(rf_path);
- rf_path = NULL;
} else {
/* We failed to open it. If we failed for some reason other than
"it doesn't exist", return the errno and the pathname, so our
@@ -1250,14 +1248,17 @@ recent_read_static(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
+ return FALSE;
}
}
+ g_free(rf_path);
+ return TRUE;
}
/* opens the user's recent file and read the first part */
-void
+gboolean
recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
{
char *rf_path, *rf_common_path;
@@ -1322,8 +1323,6 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
fclose(rf);
}
g_free(rf_common_path);
- g_free(rf_path);
- rf_path = NULL;
} else {
/* We failed to open it. If we failed for some reason other than
"it doesn't exist", return the errno and the pathname, so our
@@ -1331,12 +1330,15 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
+ return FALSE;
}
}
+ g_free(rf_path);
+ return TRUE;
}
/* opens the user's recent file and read it out */
-void
+gboolean
recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
{
char *rf_path;
@@ -1361,8 +1363,6 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
dfilter_combo_add_empty();
#endif
fclose(rf);
- g_free(rf_path);
- rf_path = NULL;
} else {
/* We failed to open it. If we failed for some reason other than
"it doesn't exist", return the errno and the pathname, so our
@@ -1370,8 +1370,11 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
+ return FALSE;
}
}
+ g_free(rf_path);
+ return TRUE;
}
gint