]> granicus.if.org Git - pdns/commitdiff
fix in-tree compilation of pdns_recursor (unsupported) plus improve case insensitive...
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Aug 2014 13:49:40 +0000 (15:49 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Aug 2014 13:49:40 +0000 (15:49 +0200)
pdns/Makefile.am
pdns/misc.hh

index a1d72363611d09faae7943354421ac7af995a2c4..7334fed3fb23dedbf1db29e62fa0e057819a1280 100644 (file)
@@ -339,7 +339,8 @@ dns_random.cc \
 lua-pdns.cc lua-pdns.hh lua-recursor.cc lua-recursor.hh randomhelper.cc  \
 recpacketcache.cc recpacketcache.hh dns.cc nsecrecords.cc base32.cc cachecleaner.hh \
 ws-recursor.cc ws-recursor.hh ws-api.cc ws-api.hh webserver.cc webserver.hh \
-json.cc json.hh version.hh version.cc responsestats.cc rec-carbon.cc
+json.cc json.hh version.hh version.cc responsestats.cc rec-carbon.cc ext/yahttp/yahttp/reqresp.cpp \
+ext/yahttp/yahttp/router.cpp
 
 pdns_recursor_LDFLAGS= $(LUA_LIBS)
 pdns_recursor_LDADD= $(POLARSSL_LIBS) $(YAHTTP_LIBS)
index a503f8da68788cc2e322ae48d378f17736347d34..81291a3742343f7e175ad156fc579ba55d0d6b42 100644 (file)
@@ -311,16 +311,16 @@ inline bool pdns_ilexicographical_compare(const std::string& a, const std::strin
 inline bool pdns_ilexicographical_compare(const std::string& a, const std::string& b)
 {
   const unsigned char *aPtr = (const unsigned char*)a.c_str(), *bPtr = (const unsigned char*)b.c_str();
-
-  while(*aPtr && *bPtr) {
+  const unsigned char *aEptr = aPtr + a.length(), *bEptr = bPtr + b.length();
+  while(aPtr != aEptr && bPtr != bEptr) {
     if ((*aPtr != *bPtr) && (dns_tolower(*aPtr) - dns_tolower(*bPtr)))
       return (dns_tolower(*aPtr) - dns_tolower(*bPtr)) < 0;
     aPtr++;
     bPtr++;
   }
-  if(!*aPtr && !*bPtr) // strings are equal (in length)
+  if(aPtr == aEptr && bPtr == bEptr) // strings are equal (in length)
     return false;
-  return !*aPtr; // true if first string was shorter
+  return aPtr == aEptr; // true if first string was shorter
 }
 
 inline bool pdns_iequals(const std::string& a, const std::string& b) __attribute__((pure));