]> granicus.if.org Git - apache/commitdiff
Merge r1491564 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 26 Jun 2013 13:00:03 +0000 (13:00 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 26 Jun 2013 13:00:03 +0000 (13:00 +0000)
const goodness with nasty strrchr and strchr functions
(resolve warning in maintainer mode)

Submitted by: trawick
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1496914 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/cache/cache_storage.c

diff --git a/STATUS b/STATUS
index 9e3b77497d1bfdead02fbd61bdf6e948cc9acf1d..189afcd1353dc5229c4282be81a9ea912f0a9005 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -97,12 +97,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
     2.4.x patch: trunk patch works modulo CHANGES
     +1: trawick, jorton, jim
 
-  * mod_cache: Fix new const warnings
-    (cache_storage.c:581:13: warning: passing argument 1 of 'ap_strrchr' discards 'const' qualifier from pointer target type)
-    trunk patch: http://svn.apache.org/r1491564
-    2.4.x patch: trunk patch works
-    +1: trawick, jorton, jim
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 38080fdbccf95b08beae19a125d0549b74d43714..af60a39b84ff36367c96bcfd6a6878663b7a6294 100644 (file)
@@ -571,17 +571,17 @@ static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
         identifier = (char **) conf->ignore_session_id->elts;
         for (i = 0; i < conf->ignore_session_id->nelts; i++, identifier++) {
             int len;
-            char *param;
+            const char *param;
 
             len = strlen(*identifier);
             /*
              * Check that we have a parameter separator in the last segment
              * of the path and that the parameter matches our identifier
              */
-            if ((param = strrchr(path, ';'))
+            if ((param = ap_strrchr_c(path, ';'))
                     && !strncmp(param + 1, *identifier, len)
                     && (*(param + len + 1) == '=')
-                    && !strchr(param + len + 2, '/')) {
+                    && !ap_strchr_c(param + len + 2, '/')) {
                 path = apr_pstrndup(p, path, param - path);
                 continue;
             }
@@ -612,7 +612,7 @@ static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
                     }
                 }
                 if (param) {
-                    char *amp;
+                    const char *amp;
 
                     if (querystring != param) {
                         querystring = apr_pstrndup(p, querystring,
@@ -622,7 +622,7 @@ static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
                         querystring = "";
                     }
 
-                    if ((amp = strchr(param + len + 1, '&'))) {
+                    if ((amp = ap_strchr_c(param + len + 1, '&'))) {
                         querystring = apr_pstrcat(p, querystring, amp + 1,
                                 NULL);
                     }