diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-12 15:58:20 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-12 15:58:20 +0800 |
commit | f61aa6b19cefdd94f2605c565ed451dbc2788936 (patch) | |
tree | 8a091c2721ab67479a2df3936d7c27c0c2c865f5 /shell | |
parent | 30436b730b5e470f17e587ce00b02a47c31b1be9 (diff) | |
download | gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.gz gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.bz2 gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.lz gsoc2013-evolution-f61aa6b19cefdd94f2605c565ed451dbc2788936.tar.xz 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')
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/e-shell.c | 14 |
2 files changed, 14 insertions, 7 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index de019dd64e..8e1e4ad648 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +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. + 2004-03-10 Bill Zhu <bill.zhu@sun.com> * e-shell-startup-wizzard.c (key_press_event_callback): Used the stock 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; } |