apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r602693 - in /apr/apr-util/branches/1.2.x: CHANGES test/testuri.c uri/apr_uri.c
Date Sun, 09 Dec 2007 16:13:46 GMT
Author: rpluem
Date: Sun Dec  9 08:13:45 2007
New Revision: 602693

URL: http://svn.apache.org/viewvc?rev=602693&view=rev
Log:
Merge r602477, r602478 from trunk:

* Ensure that apr_uri_unparse does not add scheme to URI if
  APR_URI_UNP_OMITSITEPART flag is set.

PR: 44044
Submitted by: Michael Clark <michael metaparadigm.com>
Reviewed by: rpluem

Modified:
    apr/apr-util/branches/1.2.x/CHANGES
    apr/apr-util/branches/1.2.x/test/testuri.c
    apr/apr-util/branches/1.2.x/uri/apr_uri.c

Modified: apr/apr-util/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/CHANGES?rev=602693&r1=602692&r2=602693&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.2.x/CHANGES [utf-8] Sun Dec  9 08:13:45 2007
@@ -2,6 +2,10 @@
 
 Changes with APR-util 1.2.13
 
+  *) Ensure that apr_uri_unparse does not add scheme to URI if
+     APR_URI_UNP_OMITSITEPART flag is set. PR 44044.
+     [Michael Clark <michael metaparadigm.com>]
+
   *) Add better scheme/host parsing to apr_uri.
      [Henry Jen <henryjen ztune.net>]
 

Modified: apr/apr-util/branches/1.2.x/test/testuri.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/test/testuri.c?rev=602693&r1=602692&r2=602693&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/test/testuri.c (original)
+++ apr/apr-util/branches/1.2.x/test/testuri.c Sun Dec  9 08:13:45 2007
@@ -218,6 +218,19 @@
 
             s = apr_uri_unparse(p, &info, APR_URI_UNP_REVEALPASSWORD);
             ABTS_STR_EQUAL(tc, s, t->uri);
+
+            s = apr_uri_unparse(p, &info, APR_URI_UNP_OMITSITEPART);
+            rv = apr_uri_parse(p, s, &info);
+            ABTS_STR_EQUAL(tc, info.scheme, NULL);
+            ABTS_STR_EQUAL(tc, info.hostinfo, NULL);
+            ABTS_STR_EQUAL(tc, info.user, NULL);
+            ABTS_STR_EQUAL(tc, info.password, NULL);
+            ABTS_STR_EQUAL(tc, info.hostname, NULL);
+            ABTS_STR_EQUAL(tc, info.port_str, NULL);
+            ABTS_STR_EQUAL(tc, info.path, t->path);
+            ABTS_STR_EQUAL(tc, info.query, t->query);
+            ABTS_STR_EQUAL(tc, info.user, NULL);
+            ABTS_INT_EQUAL(tc, info.port, 0);
         }
     }
 }

Modified: apr/apr-util/branches/1.2.x/uri/apr_uri.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/uri/apr_uri.c?rev=602693&r1=602692&r2=602693&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/uri/apr_uri.c (original)
+++ apr/apr-util/branches/1.2.x/uri/apr_uri.c Sun Dec  9 08:13:45 2007
@@ -92,12 +92,6 @@
                                     unsigned flags)
 {
     char *ret = "";
-    char *scheme = NULL;
-
-    if (uptr->scheme) {
-        scheme = apr_pstrcat(p, uptr->scheme, ":", NULL);
-    }
-
 
     /* If suppressing the site part, omit both user name & scheme://hostname */
     if (!(flags & APR_URI_UNP_OMITSITEPART)) {
@@ -140,9 +134,10 @@
                         is_default_port ? "" : uptr->port_str,
                         NULL);
         }
+	if (uptr->scheme) {
+	    ret = apr_pstrcat(p, uptr->scheme, ":", ret, NULL);
+	}
     }
-
-    ret = apr_pstrcat(p, scheme ? scheme : "", ret, NULL);
     
     /* Should we suppress all path info? */
     if (!(flags & APR_URI_UNP_OMITPATHINFO)) {



Mime
View raw message