apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Travis <jtra...@covalent.net>
Subject Re: [PATCH] apr_uri_unparse_components
Date Thu, 19 Jul 2001 22:48:37 GMT
On Wed, Jul 18, 2001 at 05:22:13PM -0700, Jon Travis wrote:
> 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


Dean pointed out a compiler warning that -Wall gives in the original
patch, so here's an update.  Why is -Wall not the default, anyway?


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 22:41:21
@@ -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) {


Mime
View raw message