From d55f6b53048a26ae495294c36aade82d97b46606 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Thu, 12 Feb 2009 18:31:00 +0100
Subject: 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.
---
 src/database.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/database.c b/src/database.c
index 1fed8ddcf..413aebdfa 100644
--- a/src/database.c
+++ b/src/database.c
@@ -315,13 +315,11 @@ db_load(void)
 			tempCharset = path_get_fs_charset();
 			if (tempCharset != NULL
 			    && strcmp(fsCharset, tempCharset)) {
-				g_message("Using \"%s\" for the "
-					  "filesystem charset "
+				g_message("Existing database has charset \"%s\" "
 					  "instead of \"%s\"; "
-					  "maybe you need to "
-					  "recreate the db?",
-					fsCharset, tempCharset);
-				path_set_fs_charset(fsCharset);
+					  "discarding database file",
+					  fsCharset, tempCharset);
+				return false;
 			}
 		} else
 			g_error("unknown line in db info: %s",
-- 
cgit v1.2.3