diff options
author | Mike Buland <eichlan@xagasoft.com> | 2019-04-09 13:39:57 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2019-04-09 13:39:57 -0700 |
commit | d81e824732c33e2d5ce31fbc58571561a8d9b21f (patch) | |
tree | 92a660482d33572be622070bdb5b1e5e934251ab /src/unstable/url.cpp | |
parent | 33d08f7b68ee57824c135c927bf86ca5fa3444cb (diff) | |
download | libbu++-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.
Diffstat (limited to 'src/unstable/url.cpp')
-rw-r--r-- | src/unstable/url.cpp | 10 |
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 | ||
124 | void Bu::Url::parseUserPass( Bu::String::const_iterator &i ) | 124 | void 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 ); |