[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kioslave/http
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2009-03-23 7:16:56
Message-ID: 1237792616.203457.1275.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 943001 by ahartmetz:

I strongly disagree with hiding the useful action of a loop in side effects. Of \
course it *does* make sense to fix the compiler warning though... misplaced \
parentheses.

 M  +4 -2      http.cpp  


--- trunk/KDE/kdelibs/kioslave/http/http.cpp #943000:943001
@@ -3519,7 +3519,7 @@
   }
 
   if (config()->readEntry("PropagateHttpHeader", false) ||
-      ((m_request.cacheTag.useCache) && m_request.cacheTag.writeToCache)) {
+      (m_request.cacheTag.useCache && m_request.cacheTag.writeToCache)) {
       // store header lines if they will be used; note that the tokenizer removing
       // line continuation special cases is probably more good than bad.
       int nextLinePos = 0;
@@ -3528,7 +3528,9 @@
       while (haveMore) {
           haveMore = nextLine(buffer, &nextLinePos, bufPos);
           int prevLineEnd = nextLinePos;
-          for (; buffer[prevLineEnd - 1] == '\r' || buffer[prevLineEnd - 1] == '\n'; \
--prevLineEnd) ; +          while (buffer[prevLineEnd - 1] == '\r' || \
buffer[prevLineEnd - 1] == '\n') { +              prevLineEnd--;
+          }
 
           m_responseHeaders.append(QString::fromLatin1(&buffer[prevLinePos],
                                                        prevLineEnd - prevLinePos));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic