[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#100046: apt no_proxy parsing is broken



Package: apt
Version: 0.5.3

apt only matches successfully against the first host/domain listed in
the no_proxy environment variable.

Here's a fix:

--------8<---------8<-------- CUT HERE --------8<---------8<--------
--- strutl.cc.orig	Tue Feb 27 15:14:22 2001
+++ strutl.cc	Fri Jun  8 14:03:21 2001
@@ -893,7 +893,7 @@
 	 continue;
       
       // Match the end of the string..
-      if ((Host.size() >= (unsigned)(Cur - List.begin())) &&
+      if ((Host.size() >= (unsigned)(Cur - Start)) &&
 	  Cur - Start != 0 &&
 	  stringcasecmp(Host.end() - (Cur - Start),Host.end(),Start,Cur) == 0)
 	 return true;
--------8<---------8<-------- CUT HERE --------8<---------8<--------

I'm a little surprised that the string isn't split at commas using
something a little higher level.  strtok_r(3) should do a reliable
job, especially since the code is more C than C++ anyway.  Otherwise,
there should be something in the STL...

Regards,
Martin

-- 
Martin Schwenke <schwenke@au.ibm.com>
IBM OzLabs Linux Development Team
Canberra, Australia



Reply to: