httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1061695 - in /httpd/httpd/trunk: include/httpd.h server/util.c
Date Fri, 21 Jan 2011 09:03:52 GMT
Author: sf
Date: Fri Jan 21 09:03:52 2011
New Revision: 1061695

URL: http://svn.apache.org/viewvc?rev=1061695&view=rev
Log:
Make ap_pstr2_alnum accept const char dest

Modified:
    httpd/httpd/trunk/include/httpd.h
    httpd/httpd/trunk/server/util.c

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1061695&r1=1061694&r2=1061695&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Fri Jan 21 09:03:52 2011
@@ -1839,7 +1839,8 @@ AP_DECLARE(int) ap_request_has_body(requ
  * @param  dest cleaned up, allocated string
  * @return Status value indicating whether the cleaning was successful or not.
  */
-AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src, char **dest);
+AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src,
+                                        const char **dest);
 
 /**
  * Cleanup a string (mainly to be filesystem safe)

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1061695&r1=1061694&r2=1061695&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Fri Jan 21 09:03:52 2011
@@ -2183,10 +2183,12 @@ AP_DECLARE(apr_status_t) ap_str2_alnum(c
     
 }
 
-AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src, char **dest)
+AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src,
+                                        const char **dest)
 {
-    *dest = apr_palloc(p, strlen(src)+1);
-    if (!*dest)
+    char *new = apr_palloc(p, strlen(src)+1);
+    if (!new)
         return APR_ENOMEM;
-    return ap_str2_alnum(src, *dest);
+    *dest = new;
+    return ap_str2_alnum(src, new);
 }



Mime
View raw message