It is possible unparse a URI into something like:
"http://@foo.bar.com";, if a username or password is given, and
the OMITUSER and OMITPASSWORD fields are blank.  This should
do the job (though that section of the code is particularly
ugly).


-- Jon


Index: apr_uri.c
===================================================================
RCS file: /home/cvspublic/apr-util/uri/apr_uri.c,v
retrieving revision 1.6
diff -u -u -r1.6 apr_uri.c
--- apr_uri.c   2001/06/13 22:56:23     1.6
+++ apr_uri.c   2001/07/19 00:14:53
@@ -139,7 +139,9 @@
                        (uptr->password && !(flags & UNP_OMITPASSWORD))
                           ? ((flags & UNP_REVEALPASSWORD) ? uptr->password : 
"XXXXXXXX")
                           : "",
-                       "@", NULL);
+                       (uptr->user && !(flags & UNP_OMITUSER) ||
+                        uptr->password && !(flags & UNP_OMITPASSWORD)) ? "@" 
+                        : "", NULL);
 
        /* Construct scheme://site string */
        if (uptr->hostname) {

Reply via email to