Bug 1463266 - Fix white-space issue in nsMsgBodyHandler::StripHtml(). rs=white-space-only
authorJorg K <jorgk@jorgk.com>
Fri, 26 Oct 2018 19:11:42 +0200
changeset 33589 00ddcafd807acb58b93daa796217a5a5345b5705
parent 33588 fb0fff3cd0f7f3b33d779c393e4dabf06e371488
child 33590 bc99383f0a1c44b15ae82da073f3dc2fbcae5d4d
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewerswhite-space-only
bugs1463266
Bug 1463266 - Fix white-space issue in nsMsgBodyHandler::StripHtml(). rs=white-space-only
mailnews/base/search/src/nsMsgBodyHandler.cpp
--- a/mailnews/base/search/src/nsMsgBodyHandler.cpp
+++ b/mailnews/base/search/src/nsMsgBodyHandler.cpp
@@ -339,35 +339,36 @@ int32_t nsMsgBodyHandler::ApplyTransform
     eatThisLine = true;
     return buf.Length();
   }
 
   buf.Assign(line);
   return buf.Length();
 }
 
-void nsMsgBodyHandler::StripHtml (nsCString &pBufInOut)
+void nsMsgBodyHandler::StripHtml(nsCString &pBufInOut)
 {
   char *pBuf = (char*) PR_Malloc (pBufInOut.Length() + 1);
   if (pBuf)
   {
     char *pWalk = pBuf;
 
     char *pWalkInOut = (char *) pBufInOut.get();
     bool inTag = false;
     while (*pWalkInOut) // throw away everything inside < >
     {
-      if (!inTag)
+      if (!inTag) {
         if (*pWalkInOut == '<')
           inTag = true;
         else
           *pWalk++ = *pWalkInOut;
-        else
-          if (*pWalkInOut == '>')
-            inTag = false;
+      } else {
+        if (*pWalkInOut == '>')
+          inTag = false;
+      }
       pWalkInOut++;
     }
     *pWalk = 0; // null terminator
 
     pBufInOut.Adopt(pBuf);
   }
 }