Bug 821914 - Unable to post or save a draft to Newsgroups; r=irving
authorKarsten Düsterloh <mnyromyr@tprac.de>
Thu, 20 Dec 2012 16:01:43 +0100
changeset 14921 95509c6b80328797e811a24974c32a6ca9d90517
parent 14920 ec9f4a50e3b480f6ccde8aab627184900c41adb4
child 14922 ff830fd6b02af49eb8591846e731ef82277ea8e7
push id157
push userCallek@gmail.com
push dateSun, 31 Mar 2013 06:53:46 +0000
reviewersirving
bugs821914
Bug 821914 - Unable to post or save a draft to Newsgroups; r=irving
mailnews/news/src/nsNntpService.cpp
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -721,29 +721,28 @@ nsNntpService::GenerateNewsHeaderValsFor
   // news://group
   // host/group
   // group
   //
   // we are not going to allow the user to cross post to multiple hosts.
   // if we detect that, we stop and return error.
 
   nsAutoCString host;
-  nsAutoCString str;
   nsAutoCString newsgroups;
 
   nsTArray<nsCString> list;
   ParseString(newsgroupsList, ',', list);
   for (uint32_t index = 0; index < list.Length(); index++)
   {
     list[index].StripWhitespace();
     if (!list[index].IsEmpty())
     {
       nsAutoCString currentHost;
       nsAutoCString theRest;
-      // does str start with "news:/"?
+      // does list[index] start with "news:/"?
       if (StringBeginsWith(list[index], NS_LITERAL_CSTRING(kNewsRootURI)))
       {
         // we have news://group or news://host/group
         // set theRest to what's after news://
         theRest = Substring(list[index], kNewsRootURILen /* for news:/ */ + 1 /* for the slash */);
       }
       else if (list[index].Find(":/") != -1)
       {
@@ -771,24 +770,24 @@ nsNntpService::GenerateNewsHeaderValsFor
 
         // build up the newsgroups
         if (!newsgroups.IsEmpty())
           newsgroups += ",";
         newsgroups += currentGroup;
       }
       else
       {
-        // str is "group"
-        rv = FindHostFromGroup(currentHost, str);
+        // theRest is "group"
+        rv = FindHostFromGroup(currentHost, theRest);
         if (NS_FAILED(rv))
           return rv;
         // build up the newsgroups
         if (!newsgroups.IsEmpty())
           newsgroups += ",";
-        newsgroups += list[index];
+        newsgroups += theRest;
       }
 
       if (!currentHost.IsEmpty())
       {
         if (host.IsEmpty())
           host = currentHost;
         else
         {