From: Matthew Iselin <[email protected]>

Signed-off-by: Matthew Iselin <[email protected]>
---
 src/core/uri.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/core/uri.c b/src/core/uri.c
index 1cbf1f1..d339faa 100644
--- a/src/core/uri.c
+++ b/src/core/uri.c
@@ -166,10 +166,9 @@ struct uri * parse_uri ( const char *uri_string ) {
                }
 
                /* Split host into host[:port] */
-               if ( ( tmp = strchr ( uri->host, ':' ) ) ) {
+               if ( ( tmp = strrchr ( uri->host, ':' ) ) ) {
                        /* Make sure an IPv6 address isn't broken up. */
-                       if ( ( strchr ( uri->host, '[' ) == 0 ) ||
-                            ( tmp > strchr ( uri->host, ']' ) ) ) {
+                       if ( ( tmp > strchr ( uri->host, ']' ) ) ) {
                                *(tmp++) = '\0';
                                uri->port = tmp;
                        }
-- 
1.7.2.5

_______________________________________________
gPXE-devel mailing list
[email protected]
http://etherboot.org/mailman/listinfo/gpxe-devel

Reply via email to