diff options
author | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-02-08 20:51:39 +0000 |
---|---|---|
committer | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-02-08 20:51:39 +0000 |
commit | f04147be657f4b7e588bedefc655b925bb710240 (patch) | |
tree | 5e29df29e90c52d0405063f0c14cbf37d2352917 /libproxy/proxy.cpp | |
parent | cb2fab7f2900aeedfe473aed77df8dc9c20384c0 (diff) | |
download | libproxy-f04147be657f4b7e588bedefc655b925bb710240.tar.gz |
fix a never-exit-a-loop bug
git-svn-id: http://libproxy.googlecode.com/svn/trunk@530 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libproxy/proxy.cpp')
-rw-r--r-- | libproxy/proxy.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp index e583eb5..151dc09 100644 --- a/libproxy/proxy.cpp +++ b/libproxy/proxy.cpp @@ -198,15 +198,12 @@ vector<string> proxy_factory::get_proxies(string __url) { /* Check our ignore patterns */ ignores = this->mm.get_extensions<ignore_extension>(); - for (int i=-1 ; i < (int) confign.size() ; ) { - for (vector<ignore_extension*>::iterator it=ignores.begin() ; it != ignores.end() ; it++) { - if ((*it)->ignore(*realurl, confign.substr(i+1, confign.find(',')))) - goto do_return; - } + for (size_t i=0 ; i < confign.size() && i != string::npos ; i=confign.substr(i).find(',')) { + while (i < confign.size() && confign[i] == ',') i++; - i = confign.find(','); - if (i < 0) - break; + for (vector<ignore_extension*>::iterator it=ignores.begin() ; it != ignores.end() ; it++) + if ((*it)->ignore(*realurl, confign.substr(i, confign.find(',')))) + goto do_return; } /* If we have a wpad config */ |