aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-12 15:58:20 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-12 15:58:20 +0800
commitf61aa6b19cefdd94f2605c565ed451dbc2788936 (patch)
tree8a091c2721ab67479a2df3936d7c27c0c2c865f5 /shell/e-shell.c
parent30436b730b5e470f17e587ce00b02a47c31b1be9 (diff)
downloadgsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.gz
gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.zst
gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.zip
when we check the evolution dir exists, check the evolution dir exists,
2004-03-12 Not Zed <NotZed@Ximian.com> * e-shell.c (detect_version): when we check the evolution dir exists, check the evolution dir exists, not the config.xmldb file. Move filename building/usage into the else condition so it can't happen again. Fixes #53277. svn path=/trunk/; revision=25040
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 18909bd0ff..8068d0a145 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -473,18 +473,17 @@ e_shell_init (EShell *shell)
static gboolean
detect_version (GConfClient *gconf, int *major, int *minor, int *revision)
{
- char *val, *evolution_dir, *filename;
+ char *val, *evolution_dir;
struct stat st;
evolution_dir = g_build_filename (g_get_home_dir (), "evolution", NULL);
- filename = g_build_filename (evolution_dir, "config.xmldb", NULL);
val = gconf_client_get_string(gconf, "/apps/evolution/version", NULL);
if (val) {
/* Since 1.4.0 We've been keeping the version key in gconf */
sscanf(val, "%u.%u.%u", major, minor, revision);
g_free(val);
- } else if (lstat (filename, &st) != 0 || !S_ISDIR (st.st_mode)) {
+ } else if (lstat (evolution_dir, &st) != 0 || !S_ISDIR (st.st_mode)) {
/* If ~/evolution does not exit or is not a directory it must be a new installation */
*major = 0;
*minor = 0;
@@ -493,10 +492,12 @@ detect_version (GConfClient *gconf, int *major, int *minor, int *revision)
xmlDocPtr config_doc = NULL;
xmlNodePtr source;
char *tmp;
-
- if (lstat(filename, &st) == 0
+
+ tmp = g_build_filename (evolution_dir, "config.xmldb", NULL);
+ if (lstat(tmp, &st) == 0
&& S_ISREG(st.st_mode))
- config_doc = xmlParseFile (filename);
+ config_doc = xmlParseFile (tmp);
+ g_free (tmp);
tmp = NULL;
if (config_doc
@@ -518,7 +519,6 @@ detect_version (GConfClient *gconf, int *major, int *minor, int *revision)
}
g_free (evolution_dir);
- g_free (filename);
return TRUE;
}