You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2026/08/06 13:42:08 UTC

svn commit: r1936921 - in apr/apr-util/branches/1.6.x: . dbd

Author: rpluem
Date: Thu Aug  6 13:42:07 2026
New Revision: 1936921

Log:
Merge r1936917, r1936918 from trunk:

* Fix const'ness similar to r1936843

* We need to return const char *. No need to lose const'ness
Submitted by: rpluem
Reviewed by: rpluem

Modified:
   apr/apr-util/branches/1.6.x/   (props changed)
   apr/apr-util/branches/1.6.x/dbd/apr_dbd_odbc.c
   apr/apr-util/branches/1.6.x/dbd/apr_dbd_oracle.c

Modified: apr/apr-util/branches/1.6.x/dbd/apr_dbd_odbc.c
==============================================================================
--- apr/apr-util/branches/1.6.x/dbd/apr_dbd_odbc.c	Thu Aug  6 13:41:32 2026	(r1936920)
+++ apr/apr-util/branches/1.6.x/dbd/apr_dbd_odbc.c	Thu Aug  6 13:42:07 2026	(r1936921)
@@ -1436,7 +1436,7 @@ static const char *odbc_escape(apr_pool_
 
     /* return the original if there are no single-quotes */
     if (!(sq = strchr(s, '\''))) 
-        return (char *)s;
+        return s;
     /* count the single-quotes and allocate a new buffer */
     for (qcount = 1; (sq = strchr(sq + 1, '\'')); )
         qcount++;

Modified: apr/apr-util/branches/1.6.x/dbd/apr_dbd_oracle.c
==============================================================================
--- apr/apr-util/branches/1.6.x/dbd/apr_dbd_oracle.c	Thu Aug  6 13:41:32 2026	(r1936920)
+++ apr/apr-util/branches/1.6.x/dbd/apr_dbd_oracle.c	Thu Aug  6 13:42:07 2026	(r1936921)
@@ -848,19 +848,20 @@ static int dbd_oracle_query(apr_dbd_t *s
 static const char *dbd_oracle_escape(apr_pool_t *pool, const char *arg,
                                      apr_dbd_t *sql)
 {
-    char *newstr, *src, *dst, *sq;
+    char *newstr, *dst;
+    const char *src, *sq;
     int qcount;
 
     /* return the original if there are no single-quotes */
     if (!(sq = strchr(arg, '\'')))
-        return (char *)arg;
+        return arg;
     /* count the single-quotes and allocate a new buffer */
     for (qcount = 1; (sq = strchr(sq + 1, '\'')); )
         qcount++;
     newstr = apr_palloc(pool, strlen(arg) + qcount + 1);
 
     /* move chars, doubling all single-quotes */
-    src = (char *)arg;
+    src = arg;
     for (dst = newstr; *src; src++) {
         if ((*dst++ = *src) == '\'')
             *dst++ = '\'';