summaryrefslogtreecommitdiffabout
path: root/lib/util.cc
Unidiff
Diffstat (limited to 'lib/util.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/util.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/util.cc b/lib/util.cc
index 83f0eef..4600576 100644
--- a/lib/util.cc
+++ b/lib/util.cc
@@ -212,27 +212,27 @@ namespace opkele {
212 } 212 }
213 transform( 213 transform(
214 uri.begin()+colon+3,uri.begin()+interesting, 214 uri.begin()+colon+3,uri.begin()+interesting,
215 back_inserter(rv), ::tolower ); 215 back_inserter(rv), ::tolower );
216 bool qf = false; 216 bool qf = false;
217 char ic = uri[interesting]; 217 char ic = uri[interesting];
218 if(ic==':') { 218 if(ic==':') {
219 string::size_type ni = uri.find_first_of("/#?%",interesting+1); 219 string::size_type ni = uri.find_first_of("/#?%",interesting+1);
220 const char *nptr = uri.data()+interesting+1; 220 const char *nptr = uri.data()+interesting+1;
221 char *eptr = 0; 221 char *eptr = 0;
222 long port = strtol(nptr,&eptr,10); 222 long port = strtol(nptr,&eptr,10);
223 if( (port>0) && (port<65535) && port!=(s?443:80) ) { 223 if( (port>0) && (port<65535) && port!=(s?443:80) ) {
224 char tmp[6]; 224 char tmp[8];
225 snprintf(tmp,sizeof(tmp),"%ld",port); 225 snprintf(tmp,sizeof(tmp),":%ld",port);
226 rv += ':'; rv += tmp; 226 rv += tmp;
227 } 227 }
228 if(ni==string::npos) { 228 if(ni==string::npos) {
229 rv += '/'; return rv; 229 rv += '/'; return rv;
230 } 230 }
231 interesting = ni; 231 interesting = ni;
232 }else if(ic!='/') { 232 }else if(ic!='/') {
233 rv += '/'; rv += ic; 233 rv += '/'; rv += ic;
234 qf = true; 234 qf = true;
235 ++interesting; 235 ++interesting;
236 } 236 }
237 string::size_type n = interesting; 237 string::size_type n = interesting;
238 char tmp[3] = { 0,0,0 }; 238 char tmp[3] = { 0,0,0 };