[libgda/LIBGDA_4.2] SQLite: better handle .db file extension



commit d268a925d0ea3bc9e8b31eaaa8c463b4b0df6eab
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Aug 31 18:39:33 2011 +0200

    SQLite: better handle .db file extension

 libgda/sqlite/gda-sqlite-provider.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index e7f5b67..c20c883 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -795,16 +795,15 @@ gda_sqlite_provider_open_connection (GdaServerProvider *provider, GdaConnection
 				g_static_rec_mutex_unlock (&cnc_mutex);
 				return FALSE;
 			}
-			
-			/* try first without the file extension */
-			filename = g_build_filename (dirname, dbname, NULL);
+
+			/* try first with the file extension */
+			gchar *tmp;
+			tmp = g_strdup_printf ("%s%s", dbname, FILE_EXTENSION);
+			filename = g_build_filename (dirname, tmp, NULL);
+			g_free (tmp);
 			if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
-				gchar *tmp;
 				g_free (filename);
-				tmp = g_strdup_printf ("%s%s", dbname, FILE_EXTENSION);
-				filename = g_build_filename (dirname, tmp, NULL);
-				g_free (tmp);
-				
+				filename = g_build_filename (dirname, dbname, NULL);
 			}
 			g_free (dup);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]