apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r372442 - /apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c
Date Thu, 26 Jan 2006 05:08:40 GMT
Author: rooneg
Date: Wed Jan 25 21:08:39 2006
New Revision: 372442

URL: http://svn.apache.org/viewcvs?rev=372442&view=rev
Log:
Merge r349448 into 1.2.x.

Original log message:

Fix args counting in apr_dbd_prepare in case of double-%
(thanks to Chris Darroch for pointing it out)

Modified:
    apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c

Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c?rev=372442&r1=372441&r2=372442&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c (original)
+++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_pgsql.c Wed Jan 25 21:08:39 2006
@@ -247,8 +247,13 @@
     }
     /* Translate from apr_dbd to native query format */
     for (sqlptr = (char*)query; *sqlptr; ++sqlptr) {
-        if ((sqlptr[0] == '%') && isalpha(sqlptr[1])) {
-            ++nargs;
+        if (sqlptr[0] == '%') {
+            if (isalpha(sqlptr[1])) {
+                ++nargs;
+            }
+            else if (sqlptr[1] == '%') {
+                ++sqlptr;
+            }
         }
     }
     length = strlen(query) + 1;



Mime
View raw message