summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2019-04-09 13:39:57 -0700
committerMike Buland <eichlan@xagasoft.com>2019-04-09 13:39:57 -0700
commitd81e824732c33e2d5ce31fbc58571561a8d9b21f (patch)
tree92a660482d33572be622070bdb5b1e5e934251ab
parent33d08f7b68ee57824c135c927bf86ca5fa3444cb (diff)
downloadlibbu++-d81e824732c33e2d5ce31fbc58571561a8d9b21f.tar.gz
libbu++-d81e824732c33e2d5ce31fbc58571561a8d9b21f.tar.bz2
libbu++-d81e824732c33e2d5ce31fbc58571561a8d9b21f.tar.xz
libbu++-d81e824732c33e2d5ce31fbc58571561a8d9b21f.zip
Url parser sucks. It sucks a little less now.
I need to redo it completely, it's stupid.
-rw-r--r--src/unstable/url.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/unstable/url.cpp b/src/unstable/url.cpp
index f51f381..8106ce7 100644
--- a/src/unstable/url.cpp
+++ b/src/unstable/url.cpp
@@ -123,12 +123,14 @@ void Bu::Url::setProtocol( const Bu::String &sNewProto, bool bAutoSetPort )
123 123
124void Bu::Url::parseUserPass( Bu::String::const_iterator &i ) 124void Bu::Url::parseUserPass( Bu::String::const_iterator &i )
125{ 125{
126 Bu::String::const_iterator s = i.find('@'); 126 Bu::String::const_iterator s;
127 if( !s ) 127 for( s = i; s && *s != '/' && *s != '@'; s++ ) { }
128 if( !s || *s == '/')
128 return; 129 return;
129 130
130 Bu::String::const_iterator p = i.find(':'); 131 Bu::String::const_iterator p;
131 if( p ) 132 for( p = i.find(':'); p && *p != '/' && *p != ':'; p++ ) { }
133 if( p && *p == ':' )
132 { 134 {
133 sUser.set( i, p ); 135 sUser.set( i, p );
134 sPass.set( p+1, s ); 136 sPass.set( p+1, s );