[libgda] Correction for bug #663608, for SQLite



commit 5f52f6d9ecdc2e41c0e242caa56d6756b07cb32c
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sat Nov 19 17:41:38 2011 +0100

    Correction for bug #663608, for SQLite

 libgda/sqlite/gda-sqlite-util.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libgda/sqlite/gda-sqlite-util.c b/libgda/sqlite/gda-sqlite-util.c
index 92f4db7..9dcde02 100644
--- a/libgda/sqlite/gda-sqlite-util.c
+++ b/libgda/sqlite/gda-sqlite-util.c
@@ -194,7 +194,7 @@ identifier_add_quotes (const gchar *str)
         *retval = '"';
         for (rptr = retval+1, sptr = str; *sptr; sptr++, rptr++) {
                 if (*sptr == '"') {
-                        *rptr = '\\';
+                        *rptr = '"';
                         rptr++;
                         *rptr = *sptr;
                 }
@@ -272,7 +272,17 @@ sqlite_remove_quotes (gchar *str)
 					return str;
 				}
 			}
-			if (*ptr == '\\') {
+			else if (*ptr == '"') {
+				if (*(ptr+1) == '"') {
+					g_memmove (ptr+1, ptr+2, total - offset);
+					offset += 2;
+				}
+				else {
+					*str = 0;
+					return str;
+				}
+			}
+			else if (*ptr == '\\') {
 				if (*(ptr+1) == '\\') {
 					g_memmove (ptr+1, ptr+2, total - offset);
 					offset += 2;



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