aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-10-12 21:31:17 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-10-12 21:31:17 +0800
commitc2288452b3a7181057935fdb9f28c191f7a78658 (patch)
treeb7b88fb1f58e7ab9664f904e145a3802088d92d4
parenta59599ca0ea97ff01b14129930f7999e3574fb12 (diff)
downloadgsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar.gz
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar.bz2
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar.lz
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar.xz
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.tar.zst
gsoc2013-evolution-c2288452b3a7181057935fdb9f28c191f7a78658.zip
Bug 661542 - Weird "Cannot upgrade from version 0.xxxx" on first use
GConf's default value for the version key is an empty string, which causes "sscanf (string, "%d.%d.%d", major, minor, micro)" to fail and leaves the major/minor/micro variables uninitialized. Instead, initialize the up front before reading the GConf key.
-rw-r--r--shell/e-shell-migrate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index 89f94b0f83..dd75a40b82 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -739,6 +739,10 @@ shell_migrate_get_version (EShell *shell,
const gchar *key;
gchar *string;
+ *major = 0;
+ *minor = 0;
+ *micro = 0;
+
key = GCONF_VERSION_KEY;
client = e_shell_get_gconf_client (shell);
string = gconf_client_get_string (client, key, NULL);
@@ -747,12 +751,6 @@ shell_migrate_get_version (EShell *shell,
/* Since 1.4.0 we've kept the version key in GConf. */
sscanf (string, "%d.%d.%d", major, minor, micro);
g_free (string);
-
- } else {
- /* Otherwise, assume it's a new installation. */
- *major = 0;
- *minor = 0;
- *micro = 0;
}
}