Commit d55f6b53 authored by Max Kellermann's avatar Max Kellermann

database: don't load database after charset was reconfigured

When you change the filesystem charset, discard the old database file and create a new one. The old database file will most likely contain stale or invalid information.
parent a2ce6e5b
...@@ -315,13 +315,11 @@ db_load(void) ...@@ -315,13 +315,11 @@ db_load(void)
tempCharset = path_get_fs_charset(); tempCharset = path_get_fs_charset();
if (tempCharset != NULL if (tempCharset != NULL
&& strcmp(fsCharset, tempCharset)) { && strcmp(fsCharset, tempCharset)) {
g_message("Using \"%s\" for the " g_message("Existing database has charset \"%s\" "
"filesystem charset "
"instead of \"%s\"; " "instead of \"%s\"; "
"maybe you need to " "discarding database file",
"recreate the db?",
fsCharset, tempCharset); fsCharset, tempCharset);
path_set_fs_charset(fsCharset); return false;
} }
} else } else
g_error("unknown line in db info: %s", g_error("unknown line in db info: %s",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment