[libgda/LIBGDA_4.2] Correction for bug #663608, for SQLite



commit b0085e9a613e76b2a720e19e1e808ca98f7d35db
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 00d0aec..00c4e48 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]