httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1226492 - /httpd/mod_mbox/trunk/module-2.0/mbox_parse.c
Date Mon, 02 Jan 2012 17:39:22 GMT
Author: sf
Date: Mon Jan  2 17:39:22 2012
New Revision: 1226492

URL: http://svn.apache.org/viewvc?rev=1226492&view=rev
Log:
de-confuse const and non-const pointers, to avoid compiler warnings and
a cast

Modified:
    httpd/mod_mbox/trunk/module-2.0/mbox_parse.c

Modified: httpd/mod_mbox/trunk/module-2.0/mbox_parse.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mbox_parse.c?rev=1226492&r1=1226491&r2=1226492&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mbox_parse.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mbox_parse.c Mon Jan  2 17:39:22 2012
@@ -807,28 +807,28 @@ apr_status_t mbox_generate_index(request
 
                 temp = apr_table_get(table, "Content-Type");
                 if (temp) {
-                    char *p;
-                    temp = apr_pstrdup(tpool, temp);
-                    msgc.boundary = mbox_strcasestr(temp, "boundary=");
-                    if (msgc.boundary) {
+                    char *p, *boundary, *dup;
+                    dup = apr_pstrdup(tpool, temp);
+                    boundary = mbox_strcasestr(dup, "boundary=");
+                    if (boundary) {
                         msgc.boundary += sizeof("boundary=") - 1;
-                        if (msgc.boundary[0] == '"') {
-                            ++msgc.boundary;
-                            if ((p = strstr(msgc.boundary, "\""))) {
+                        if (boundary[0] == '"') {
+                            ++boundary;
+                            if ((p = strstr(boundary, "\""))) {
                                 *p = '\0';
                             }
                         }
                         else {
-                            if ((p = strstr(msgc.boundary, ";"))) {
+                            if ((p = strstr(boundary, ";"))) {
                                 *p = '\0';
                             }
                         }
                     }
-                    p = strstr(temp, ";");
+                    msgc.boundary = boundary;
+                    p = strstr(dup, ";");
                     if (p) {
                         *p = '\0';
                     }
-                    msgc.content_type = temp;
                     /* Some old clients only sent 'text',
                      * instead of 'text/plain'. Lets try to be nice to them */
                     if (!strcasecmp(msgc.content_type, "text")) {
@@ -836,7 +836,8 @@ apr_status_t mbox_generate_index(request
                     }
                     else {
                         /* Normalize the Content-Type */
-                        ex_ap_str_tolower((char *) msgc.content_type);
+                        ex_ap_str_tolower(dup);
+                        msgc.content_type = dup;
                     }
                 }
                 else {



Mime
View raw message