Another DBD::Pg patch from Rudy Lippan (hanks!). I've added it to the patches upload page. Comments welcome.

http://gborg.postgresql.org/project/dbdpg/patch/patchlist.php

Regards,

David

Begin forwarded message:

From: Rudy Lippan <[EMAIL PROTECTED]>
Date: Tue Oct 22, 2002  2:35:15  PM US/Pacific
To: David Wheeler <[EMAIL PROTECTED]>
Subject: Re: DBD::Pg Patches


Another to add to the list -- \'s were thowing off placeholders

--- dbdimp.c.orig       Tue Oct 22 16:09:13 2002
+++ dbdimp.c    Tue Oct 22 16:09:44 2002
@@ -667,8 +667,14 @@

         if (in_literal) {
             /* check if literal ends but keep quotes in literal */
-            if (*src == in_literal && *(src-1) != '\\') {
-                in_literal = 0;
+            if (*src == in_literal) {
+                int bs=0;
+                char *str;
+                str = src-1;
+                while (*(str-bs) == '\\')
+                bs++;
+                if (!(bs & 1))
+                    in_literal = 0;
             }
             *dest++ = *src++;
             continue;
@@ -1114,8 +1120,14 @@

             if (in_literal) {
                 /* check if literal ends but keep quotes in literal */
-                if (*src == in_literal && *(src-1) != '\\') {
-                    in_literal = 0;
+                if (*src == in_literal) {
+                    int bs=0;
+                    char *str;
+                    str = src-1;
+                    while (*(str-bs) == '\\')
+                    bs++;
+                    if (!(bs & 1))
+                        in_literal = 0;
                 }
                 *dest++ = *src++;
                 continue;




--
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]

Reply via email to