[M-git] Mahogany sources repository. branch master updated. v0.67-736-g77236a4

"Nerijus Bali??nas" <[email protected]> Sun, 25 Sep 2016 14:41:08 +0000
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".

The branch, master has been updated
       via  77236a4addf673a1e44e53f89c2d7cb0c58abfc9 (commit)
       via  92c1bc1511afd3f554021a1f7f6cb92ce649e6f1 (commit)
       via  39b1b2b054225aa6e154dd326a49411cd809d2bf (commit)
       via  fa22a3969de117e2462a32e31e458d5fd16cfd36 (commit)
       via  b8e124dbd09e07159b890ee950d4fd52099374fd (commit)
       via  0c4e9d09cef22a1c201ffd4630d87a4aa66ed22a (commit)
      from  c5b1ff043da48d0265f1a4a2dbdda9426e143118 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 77236a4addf673a1e44e53f89c2d7cb0c58abfc9
Author: Vadim Zeitlin <[email protected]>
Date:   Sun Sep 25 15:54:46 2016 +0200

    Fix decoding of GPG output with non-ASCII characters
    
    Assume GPG output is in UTF-8 (because this is the case, in practice, even
    under Windows), but also handle the possibility that it can contain some byte
    sequences not valid in UTF-8 as this happens in practice as well.

diff --git a/src/modules/crypt/PGPEngine.cpp b/src/modules/crypt/PGPEngine.cpp
index 8fd02a5..c5222ee 100644
--- a/src/modules/crypt/PGPEngine.cpp
+++ b/src/modules/crypt/PGPEngine.cpp
@@ -307,7 +307,14 @@ PGPEngine::ExecCommand(const String& options,
    CHECK( in && out && err, CANNOT_EXEC_PROGRAM,
             _T("where is PGP subprocess stdin/out/err?") );
 
-   wxTextInputStream errText(*err);
+   // Lines received from GPG are normally encoded in UTF-8, but they may
+   // contain bytes sequences invalid in UTF-8 in practice, e.g. this happens
+   // under Windows when the key description itself is not in UTF-8 and gpg
+   // just seems to dump it on output directly. Because of this, we can't just
+   // use wxConvUTF8 here but need to treat the input as raw bytes and then
+   // carefully convert it wxString ourselves.
+   wxTextInputStream errText(*err, " ", wxConvISO8859_1);
+   wxMBConvUTF8 nonStrictUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_OCTAL);
 
    Status status = MAX_ERROR;
 
@@ -382,7 +389,7 @@ PGPEngine::ExecCommand(const String& options,
       }
       else if ( err->CanRead() )
       {
-         String line = errText.ReadLine();
+         String line(errText.ReadLine().To8BitData(), nonStrictUTF8);
 
          // Log all GPG messages, this is useful for diagnosing problems
          if ( log )

commit 92c1bc1511afd3f554021a1f7f6cb92ce649e6f1
Author: Vadim Zeitlin <[email protected]>
Date:   Sun Sep 25 15:32:04 2016 +0200

    Show the key used for signing correctly for expired GPG signatures
    
    Don't use GetUserID() because it won't be set yet (or even at all) when we
    received EXPKEYSIG notification and just use the key in this line itself
    instead.

diff --git a/src/modules/crypt/PGPEngine.cpp b/src/modules/crypt/PGPEngine.cpp
index 8bac187..8fd02a5 100644
--- a/src/modules/crypt/PGPEngine.cpp
+++ b/src/modules/crypt/PGPEngine.cpp
@@ -449,8 +449,7 @@ PGPEngine::ExecCommand(const String& options,
             }
             else if ( code == _T("EXPSIG") || code == _T("EXPKEYSIG") )
             {
-               wxLogWarning(_("Expired signature from \"%s\""),
-                            log->GetUserID().c_str());
+               wxLogWarning(_("Expired signature from \"%s\""), pc);
 
                status = SIGNATURE_EXPIRED_ERROR;
             }

commit 39b1b2b054225aa6e154dd326a49411cd809d2bf
Author: Vadim Zeitlin <[email protected]>
Date:   Sun Sep 25 15:27:59 2016 +0200

    Mostly ignore NOTATION_{NAME,DATA} in GPG output
    
    This gets rid of the annoying warnings about unrecognized GPG output with the
    notation data embedded into the signature.
    
    It seems like this data can be mostly ignored, and only critical data, as
    indicated by "NOTATION_FLAGS 1", should be shown, so attempt to do this,
    although this is untested as I have no examples of signatures with critical
    notation data.

diff --git a/src/modules/crypt/PGPEngine.cpp b/src/modules/crypt/PGPEngine.cpp
index e068dba..8bac187 100644
--- a/src/modules/crypt/PGPEngine.cpp
+++ b/src/modules/crypt/PGPEngine.cpp
@@ -328,6 +328,11 @@ PGPEngine::ExecCommand(const String& options,
    size_t lenIn = strlen(bufIn);
    const char *ptrIn = bufIn;
 
+   // the value of the last NOTATION_NAME line, if any, and whether it's
+   // critical
+   wxString lastNotationName;
+   bool lastNotationCritical = false;
+
    bool outEof = false,
         errEof = false;
    while ( !process.IsDone() || !outEof || !errEof )
@@ -703,6 +708,28 @@ PGPEngine::ExecCommand(const String& options,
                                  "(%s) is available."), keys.c_str());
                }
             }
+            else if ( code == "NOTATION_NAME" )
+            {
+               lastNotationName = pc;
+               lastNotationCritical = false;
+            }
+            else if ( code == "NOTATION_FLAGS" )
+            {
+               if ( *pc == '1' )
+                  lastNotationCritical = true;
+
+               // we ignore the "human readable" flag because it's not clear
+               // how exactly should it be handled
+            }
+            else if ( code == "NOTATION_DATA" )
+            {
+               const wxString data(pc);
+               if ( lastNotationCritical )
+               {
+                  wxLogWarning(_("Critical notation in the signature: %s=%s"),
+                               lastNotationName, data);
+               }
+            }
             else if ( code == _T("END_DECRYPTION") ||
                       code == _T("GOODMDC") ||     // what does it mean?
                       code == _T("GOT_IT") ||

commit fa22a3969de117e2462a32e31e458d5fd16cfd36
Author: Vadim Zeitlin <[email protected]>
Date:   Wed May 11 00:59:11 2016 +0200

    Fix bug in display of nested parts in encrypted messages
    
    The offset of the subparts was not computed correctly, it is relative to the
    parent contents start and not the start of the body of this part itself.
    
    This prevented Base64-encoded nested parts from being displayed at all in some
    cases and didn't display the start of the message even for not encoded
    messages.

diff --git a/src/mail/MimePartVirtual.cpp b/src/mail/MimePartVirtual.cpp
index e519eb4..276d07d 100644
--- a/src/mail/MimePartVirtual.cpp
+++ b/src/mail/MimePartVirtual.cpp
@@ -81,7 +81,7 @@ MimePartVirtual::MimePartVirtual(BODY *body,
 
    Create(body, parent, nPart);
 
-   m_pStart = pHeader + body->mime.offset;
+   m_pStart = pHeader + body->mime.offset - parent->m_body->contents.offset;
    m_lenHeader = body->mime.text.size - lenEOL;
    m_lenBody = body->contents.text.size;
 

commit b8e124dbd09e07159b890ee950d4fd52099374fd
Author: Vadim Zeitlin <[email protected]>
Date:   Sun May 8 19:57:00 2016 +0200

    Fix clicking on "PGP key not found" in the message viewer
    
    OnLeftClick() was not overridden in PGPInfoKeyNotFoundSig because of a
    signature mismatch.

diff --git a/include/PGPClickInfo.h b/include/PGPClickInfo.h
index 4116718..d03cef5 100644
--- a/include/PGPClickInfo.h
+++ b/include/PGPClickInfo.h
@@ -188,7 +188,7 @@ public:
    }
 
    // override this to get the missing key from server
-   virtual void OnLeftClick(const wxPoint&) const;
+   virtual void OnLeftClick() const;
 
 private:
    MCryptoEngine * const m_engine;
diff --git a/src/classes/PGPClickInfo.cpp b/src/classes/PGPClickInfo.cpp
index 63ca01f..1c332a4 100644
--- a/src/classes/PGPClickInfo.cpp
+++ b/src/classes/PGPClickInfo.cpp
@@ -256,7 +256,7 @@ ClickablePGPInfo::ShowRawText() const
 // PGPInfoKeyNotFoundSig
 // ----------------------------------------------------------------------------
 
-void PGPInfoKeyNotFoundSig::OnLeftClick(const wxPoint&) const
+void PGPInfoKeyNotFoundSig::OnLeftClick() const
 {
    MessageView * const mview = GetMessageView();
    CHECK_RET( mview, "should have the associated message view" );

commit 0c4e9d09cef22a1c201ffd4630d87a4aa66ed22a
Author: Vadim Zeitlin <[email protected]>
Date:   Sun May 8 19:48:26 2016 +0200

    Get rid of annoying variable shadowing warnings with MSVS 2015
    
    Rename MFrameBase::name to m_name to avoid warnings whenever a very common
    "name" variable was used anywhere in the code.
    
    Make the scope of local variables narrower in several places and reuse the
    existing variables in others.
    
    Finally, use unique names if the variables are really different.
    
    There should be no changes in behaviour except for one real (if minor) bug fix
    in the update code where the message string was not filled correctly before.

diff --git a/include/MFrame.h b/include/MFrame.h
index 4f7a728..43c238b 100644
--- a/include/MFrame.h
+++ b/include/MFrame.h
@@ -19,14 +19,14 @@ class MFrameBase
 {
 private:
    /// each frame has a unique name used to identify it
-   String name;
+   String m_name;
 
 public:
    /// ctor takes the name of the frame class
-   MFrameBase(const String& str) : name(str) { }
+   MFrameBase(const String& str) : m_name(str) { }
 
    /// retrieve the name of the window class
-   const char *GetName() const { return name.c_str(); }
+   const char *GetName() const { return m_name.c_str(); }
 
    // VZ: this could lead to an ambiguity as wxFrame (from which wxMFrame
    //     derives as well) has this (virtual) method too
diff --git a/src/adb/AdbManager.cpp b/src/adb/AdbManager.cpp
index 6b93620..fccbc88 100644
--- a/src/adb/AdbManager.cpp
+++ b/src/adb/AdbManager.cpp
@@ -305,17 +305,16 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
     // merge both arrays into one big one: notice that the order is important,
     // the groups should come first (see below)
     ArrayAdbElements aEverything;
-    size_t n;
 
     size_t nGroupCount = aGroups.GetCount();
-    for ( n = 0; n < nGroupCount; n++ ) {
+    for ( size_t n = 0; n < nGroupCount; n++ ) {
       aEverything.Add(aGroups[n]);
     }
 
     wxArrayString emails;
     wxString email;
     size_t nEntryCount = aEntries.GetCount();
-    for ( n = 0; n < nEntryCount; n++ ) {
+    for ( size_t n = 0; n < nEntryCount; n++ ) {
       AdbEntry *entry = aEntries[n];
 
       entry->GetField(AdbField_EMail, &email);
@@ -341,7 +340,7 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
         AdbEntryGroup *group = aGroups[index];
         wxArrayString aEntryNames;
         size_t count = group->GetEntryNames(aEntryNames);
-        for ( n = 0; n < count; n++ ) {
+        for ( size_t n = 0; n < count; n++ ) {
           AdbEntry *entry = group->GetEntry(aEntryNames[n]);
           if ( entry ) {
             results.Add(entry->GetDescription());
diff --git a/src/adb/Collect.cpp b/src/adb/Collect.cpp
index fec8a64..df324ad 100644
--- a/src/adb/Collect.cpp
+++ b/src/adb/Collect.cpp
@@ -207,14 +207,14 @@ void AutoCollectAddress(const String& email,
             entry->IncRef();
             entry->AddEMail(email);
 
-            wxString name;
-            entry->GetField(AdbField_NickName, &name);
+            wxString nickname;
+            entry->GetField(AdbField_NickName, &nickname);
             if ( frame )
             {
                wxLogStatus(frame,
                            _("Auto collected e-mail address '%s' "
                              "(added to the entry '%s')."),
-                           email.c_str(), name.c_str());
+                           email, nickname);
             }
             entry->DecRef();
          }
diff --git a/src/classes/ComposeTemplate.cpp b/src/classes/ComposeTemplate.cpp
index f4ccad3..d712cf9 100644
--- a/src/classes/ComposeTemplate.cpp
+++ b/src/classes/ComposeTemplate.cpp
@@ -956,15 +956,15 @@ VarExpander::GetAbsFilename(const String& name)
       else
       {
          // try the global dir
-         String path = READ_CONFIG(profile, MP_COMPOSETEMPLATEPATH_GLOBAL);
-         if ( path.empty() )
-            path = mApplication->GetDataDir();
-         if ( !path.empty() || path.Last() != '/' )
+         String pathGlobal = READ_CONFIG(profile, MP_COMPOSETEMPLATEPATH_GLOBAL);
+         if ( pathGlobal.empty() )
+            pathGlobal= mApplication->GetDataDir();
+         if ( !pathGlobal.empty() || pathGlobal.Last() != '/' )
          {
-            path += '/';
+            pathGlobal+= '/';
          }
 
-         filename.Prepend(path);
+         filename.Prepend(pathGlobal);
       }
    }
    //else: absolute filename given, don't look anywhere else
diff --git a/src/classes/MEvent.cpp b/src/classes/MEvent.cpp
index cb9e6ee..618d97e 100644
--- a/src/classes/MEvent.cpp
+++ b/src/classes/MEvent.cpp
@@ -218,8 +218,8 @@ void *MEventManager::Register(MEventReceiver& who, MEventId eventId)
    size_t count = gs_receivers.GetCount();
    for ( size_t n = 0; n < count; n++ )
    {
-      MEventReceiverInfo *info = gs_receivers[n];
-      if ( info->id == eventId && &(info->receiver) == &who )
+      MEventReceiverInfo *infoOld = gs_receivers[n];
+      if ( infoOld->id == eventId && &(infoOld->receiver) == &who )
       {
          FAIL_MSG( "Registering the same handler twice in "
                    "MEventManager::Register()" );
diff --git a/src/classes/MessageTemplate.cpp b/src/classes/MessageTemplate.cpp
index 8256e4f..8206a65 100644
--- a/src/classes/MessageTemplate.cpp
+++ b/src/classes/MessageTemplate.cpp
@@ -214,16 +214,16 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
                      pc++;
 
                      // quoted argument?
-                     bool quoted = *pc == '"';
-                     if ( quoted )
+                     bool quotedArg = *pc == '"';
+                     if ( quotedArg )
                         pc++;
 
                      // stop on some speical chars if not quoted, otherwise
                      // only stop at the closing quote
                      while ( *pc &&
-                              (quoted ? *pc != '"'
-                                      : !strchr("+-=, ", *pc) &&
-                                          *pc != bracketClose) )
+                              (quotedArg ? *pc != '"'
+                                         : !strchr("+-=, ", *pc) &&
+                                             *pc != bracketClose) )
                      {
                         if ( *pc == '\\' )
                         {
@@ -249,7 +249,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
                         pc++;
                      }
 
-                     if ( quoted )
+                     if ( quotedArg )
                      {
                         // skip closing quote or complain about missing one
                         if ( *pc == '"' )
diff --git a/src/classes/MessageView.cpp b/src/classes/MessageView.cpp
index 5410a9c..aa93657 100644
--- a/src/classes/MessageView.cpp
+++ b/src/classes/MessageView.cpp
@@ -2775,12 +2775,9 @@ MessageView::ProcessPart(const MimePart *mimepart, MimePartAction action)
                return true;
 
             case Part_Test:
-               {
-                  const MimeType type = mimepart->GetType();
-                  return (type.GetPrimary() == MimeType::IMAGE &&
-                           m_viewer->CanInlineImages()) ||
-                              m_viewer->CanProcess(type.GetFull());
-               }
+               return (type.GetPrimary() == MimeType::IMAGE &&
+                        m_viewer->CanInlineImages()) ||
+                           m_viewer->CanProcess(type.GetFull());
 
             default:
                FAIL_MSG( "unknown MIME part processing action" );
diff --git a/src/gui/ClickURL.cpp b/src/gui/ClickURL.cpp
index 5dbce74..5ab9456 100644
--- a/src/gui/ClickURL.cpp
+++ b/src/gui/ClickURL.cpp
@@ -480,7 +480,7 @@ void ClickableURL::OpenInBrowser(int options) const
       // either not Netscape or Netscape isn't running or we have non-UNIX
       if ( !bOk )
       {
-         const String command = ExpandExternalCommand(browser, m_url);
+         command = ExpandExternalCommand(browser, m_url);
 
          wxString errmsg;
          errmsg.Printf(_("Couldn't launch browser: '%s' failed"),
diff --git a/src/gui/wxComposeView.cpp b/src/gui/wxComposeView.cpp
index 34e4045..9c78482 100644
--- a/src/gui/wxComposeView.cpp
+++ b/src/gui/wxComposeView.cpp
@@ -2579,21 +2579,20 @@ wxComposeView::CreateEditor()
    else // have at least one editor, load it
    {
       // TODO: make it configurable
-      //String name = (*listing)[0].GetName();
-      String name = _T("BareBonesEditor");
+      String editorname = _T("BareBonesEditor");
 
-      MModule *editorFactory = MModule::LoadModule(name);
+      MModule *editorFactory = MModule::LoadModule(editorname);
       if ( !editorFactory ) // failed to load the configured editor
       {
          // try any other
          String nameFirst = (*listing)[0].GetName();
 
-         if ( name != nameFirst )
+         if ( editorname != nameFirst )
          {
             wxLogWarning(_("Failed to load the configured message editor '%s'.\n"
                            "\n"
                            "Reverting to the default message editor."),
-                         name.c_str());
+                         editorname);
 
             editorFactory = MModule::LoadModule(nameFirst);
          }
diff --git a/src/gui/wxFiltersDialog.cpp b/src/gui/wxFiltersDialog.cpp
index 2eee5ac..76df000 100644
--- a/src/gui/wxFiltersDialog.cpp
+++ b/src/gui/wxFiltersDialog.cpp
@@ -2779,9 +2779,9 @@ bool wxQuickFilterDialog::TransferDataFromWindow()
             if ( !email.empty() )
                profileTargetFolder->writeEntry(MP_FROM_ADDRESS, email);
 
-            const String& name = addr->GetName();
-            if ( !name.empty() )
-               profileTargetFolder->writeEntry(MP_PERSONALNAME, name);
+            const String& addrname = addr->GetName();
+            if ( !addrname.empty() )
+               profileTargetFolder->writeEntry(MP_PERSONALNAME, addrname);
          }
       }
    }
diff --git a/src/gui/wxFolderTree.cpp b/src/gui/wxFolderTree.cpp
index c0ffc80..9167fd5 100644
--- a/src/gui/wxFolderTree.cpp
+++ b/src/gui/wxFolderTree.cpp
@@ -3422,7 +3422,6 @@ void wxFolderTreeImpl::ProcessMsgNumberChange(const wxString& folderName)
       }
       else
       {
-         MailFolderStatus status;
          (void)mf->CountAllMessages(&status);
       }
 
diff --git a/src/gui/wxFolderView.cpp b/src/gui/wxFolderView.cpp
index 98fb35b..0b3c638 100644
--- a/src/gui/wxFolderView.cpp
+++ b/src/gui/wxFolderView.cpp
@@ -5235,16 +5235,16 @@ wxFolderView::OnASFolderResultEvent(MEventASFolderResultData &event)
             // so far we only use GetMessage() when processing
             // WXMENU_MSG_QUICK_FILTER
             {
-               Message *msg = ((ASMailFolder::ResultMessage *)result)->GetMessage();
-               if ( msg )
+               Message *message = ((ASMailFolder::ResultMessage *)result)->GetMessage();
+               if ( message )
                {
                   MFolder_obj folder(m_folderName);
 
                   String to;
-                  (void)msg->GetDecodedHeaderLine(_T("To"), to);
+                  (void)message->GetDecodedHeaderLine(_T("To"), to);
 
                   if ( CreateQuickFilter(folder,
-                                         msg->From(), msg->Subject(), to,
+                                         message->From(), message->Subject(), to,
                                          m_Frame) )
                   {
                      // ask the user if he doesn't want to test his new filter
@@ -5261,7 +5261,7 @@ wxFolderView::OnASFolderResultEvent(MEventASFolderResultData &event)
                           ) )
                      {
                         UIdArray selections;
-                        selections.Add(msg->GetUId());
+                        selections.Add(message->GetUId());
                         m_TicketList->Add(
                               m_ASMailFolder->ApplyFilterRules(&selections, this)
                            );
@@ -5269,7 +5269,7 @@ wxFolderView::OnASFolderResultEvent(MEventASFolderResultData &event)
                   }
                   //else: filter not created, nothing to apply
 
-                  msg->DecRef();
+                  message->DecRef();
                }
             }
             break;
diff --git a/src/gui/wxHeadersDialogs.cpp b/src/gui/wxHeadersDialogs.cpp
index 02d242e..4665df3 100644
--- a/src/gui/wxHeadersDialogs.cpp
+++ b/src/gui/wxHeadersDialogs.cpp
@@ -1089,10 +1089,10 @@ bool wxCustomHeadersDialog::TransferDataFromWindow()
    pathBase = CUSTOM_HEADERS_PREFIX;
    for ( size_t type = 0; type < CustomHeader_Max; type++ )
    {
-      const String name = pathBase + gs_customHeaderSubgroups[type];
+      const String path = pathBase + gs_customHeaderSubgroups[type];
       const String value = strutil_flatten_array(headersFor[type]);
-      if ( m_profile->readEntry(name, "") != value )
-         m_profile->writeEntry(name, value);
+      if ( m_profile->readEntry(path, "") != value )
+         m_profile->writeEntry(path, value);
    }
 
    // remove the organization header if it hadn't been specified: we must do it
diff --git a/src/gui/wxIconManager.cpp b/src/gui/wxIconManager.cpp
index be87166..9738819 100644
--- a/src/gui/wxIconManager.cpp
+++ b/src/gui/wxIconManager.cpp
@@ -578,7 +578,7 @@ wxIconManager::GetIcon(const String &iconNameOrig)
 #ifdef OS_WIN
    // last, look in the resources
    {
-      wxIcon icon(iconNameOrig);
+      icon = wxIcon(iconNameOrig);
       if ( icon.Ok() ) {
          wxLogTrace(wxTraceIconLoading, _T("... icon found in the ressources."));
          return icon;
diff --git a/src/gui/wxMFrame.cpp b/src/gui/wxMFrame.cpp
index 8854725..ac8bbaa 100644
--- a/src/gui/wxMFrame.cpp
+++ b/src/gui/wxMFrame.cpp
@@ -223,11 +223,11 @@ wxMFrame::SetTitle(String const &title)
 }
 
 void
-wxMFrame::Create(const String &name, wxWindow *parent)
+wxMFrame::Create(const String &framename, wxWindow *parent)
 {
    wxCHECK_RET( !m_initialised, _T("wxMFrame created twice") );
 
-   SetName(name);
+   SetName(framename);
 
    int xpos, ypos, width, height;
    bool startIconised, startMaximised;
@@ -235,7 +235,7 @@ wxMFrame::Create(const String &name, wxWindow *parent)
                    &startIconised, &startMaximised);
 
    // use name as default title
-   if ( !wxFrame::Create(parent, -1, name,
+   if ( !wxFrame::Create(parent, -1, framename,
                          wxPoint(xpos, ypos), wxSize(width,height)) )
    {
       wxFAIL_MSG( _T("Failed to create a frame!") );
diff --git a/src/gui/wxMIMETreeDialog.cpp b/src/gui/wxMIMETreeDialog.cpp
index 48685e3..0a19b7c 100644
--- a/src/gui/wxMIMETreeDialog.cpp
+++ b/src/gui/wxMIMETreeDialog.cpp
@@ -355,10 +355,10 @@ void wxMIMETreeDialog::SaveMessages(size_t count, const MimePart **parts)
          HeaderInfoList_obj hil(mf->GetHeaders());
          if ( hil )
          {
-            const size_t count = hil->Count();
+            const size_t hcount = hil->Count();
             UIdArray all;
-            all.Alloc(count);
-            for ( size_t n = 0; n < count; n++ )
+            all.Alloc(hcount);
+            for ( size_t n = 0; n < hcount; n++ )
             {
                HeaderInfo *hi = hil->GetItemByIndex(n);
                if ( hi )
diff --git a/src/gui/wxMainFrame.cpp b/src/gui/wxMainFrame.cpp
index bbad8e9..89b4348 100644
--- a/src/gui/wxMainFrame.cpp
+++ b/src/gui/wxMainFrame.cpp
@@ -1372,8 +1372,8 @@ void wxMainFrame::DoFolderSearch()
    SearchCriterium crit;
 
    Profile_obj profile(GetFolderProfile());
-   MFolder_obj folder(m_FolderTree->GetSelection());
-   if ( ConfigureSearchMessages(&crit, profile, folder, this) )
+   MFolder_obj folderSel(m_FolderTree->GetSelection());
+   if ( ConfigureSearchMessages(&crit, profile, folderSel, this) )
    {
       AsyncSearchData *searchData = NULL;
 
diff --git a/src/gui/wxMimeDialog.cpp b/src/gui/wxMimeDialog.cpp
index a9ece6e..36e9114 100644
--- a/src/gui/wxMimeDialog.cpp
+++ b/src/gui/wxMimeDialog.cpp
@@ -167,7 +167,7 @@ wxMimeOpenWithDialog::wxMimeOpenWithDialog(wxWindow *parent,
    if ( m_openAsMsg )
    {
       m_chkOpenAsMsg = new wxCheckBox(this, wxID_ANY, _("Open as &mail message"));
-      wxLayoutConstraints *c = new wxLayoutConstraints;
+      c = new wxLayoutConstraints;
       c->top.Below(m_txtCommand, 3*LAYOUT_Y_MARGIN);
       c->centreX.SameAs(this, wxCentreX);
       c->width.AsIs();
diff --git a/src/gui/wxMsgCmdProc.cpp b/src/gui/wxMsgCmdProc.cpp
index 115fd00..d69ba30 100644
--- a/src/gui/wxMsgCmdProc.cpp
+++ b/src/gui/wxMsgCmdProc.cpp
@@ -963,15 +963,15 @@ void MsgCmdProcImpl::ReclassifyAsSpam(const UIdArray& uids, bool isSpam)
    uidsReclassified.reserve(count);
    for ( size_t i = 0; i < count; i++ )
    {
-      Message_obj msg(GetMessage(uids[i]));
-      if ( !msg )
+      Message_obj message(GetMessage(uids[i]));
+      if ( !message)
       {
          wxLogError(_("Failed to retrieve the message %#08x to reclassify."),
                     uids[i]);
          continue;
       }
 
-      if ( SpamFilter::Reclassify(*msg, isSpam) )
+      if ( SpamFilter::Reclassify(*message, isSpam) )
          uidsReclassified.push_back(uids[i]);
    }
 
@@ -1776,7 +1776,7 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
 
                      // don't copy the messages to the trash, they
                      // had been already copied somewhere
-                     Ticket t = m_asmf
+                     Ticket tDel = m_asmf
                                  ? m_asmf->DeleteOrTrashMessages
                                    (
                                     seq,
@@ -1785,9 +1785,9 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
                                    )
                                  : ILLEGAL_TICKET;
 
-                     if ( t != ILLEGAL_TICKET )
+                     if ( tDel != ILLEGAL_TICKET )
                      {
-                        m_TicketList->Add(t);
+                        m_TicketList->Add(tDel);
                      }
                      else // failed to delete?
                      {
diff --git a/src/mail/MailFolder.cpp b/src/mail/MailFolder.cpp
index 96b3dca..d2da367 100644
--- a/src/mail/MailFolder.cpp
+++ b/src/mail/MailFolder.cpp
@@ -654,8 +654,6 @@ InitRecipients(Composer *cv,
    size_t countReplyTo = msg->GetAddresses(MAT_REPLYTO, replyToAddresses);
    replyToAddresses.Sort();
 
-   size_t n, count; // loop variables
-
    // REPLY_LIST overrides any Reply-To in the header
    if ( replyKind != MailFolder::REPLY_LIST )
    {
@@ -687,7 +685,7 @@ InitRecipients(Composer *cv,
       {
          wxArrayString addresses;
          size_t count = msg->GetAddresses(MAT_TO, addresses);
-         for ( n = 0; n < count; n++ )
+         for ( size_t n = 0; n < count; n++ )
          {
             rcptAddresses.Add(addresses[n]);
             rcptTypes.Add(Recipient_To);
@@ -699,7 +697,7 @@ InitRecipients(Composer *cv,
          rcptTypes.Add(Recipient_To);
 
          // add the remaining Reply-To addresses (usually there will be none)
-         for ( n = 1; n < countReplyTo; n++ )
+         for ( size_t n = 1; n < countReplyTo; n++ )
          {
             // FIXME: same as above
             rcptAddresses.Add(MIME::DecodeHeader(replyToAddresses[n]));
@@ -726,7 +724,7 @@ InitRecipients(Composer *cv,
    {
       // add all recipients in the composer in the reverse order -- so
       // that they appear there as we want them
-      n = rcptAddresses.GetCount();
+      size_t n = rcptAddresses.GetCount();
       CHECK_RET( rcptTypes.GetCount() == n, _T("logic error in InitRecipients") );
 
       while ( n-- )
@@ -770,8 +768,8 @@ InitRecipients(Composer *cv,
 #endif // 0
 
    // decode headers before comparing them
-   count = otherAddresses.GetCount();
-   for ( n = 0; n < count; n++ )
+   size_t count = otherAddresses.GetCount();
+   for ( size_t n = 0; n < count; n++ )
    {
       // FIXME: as above, we lose the original encoding here
       otherAddresses[n] = MIME::DecodeHeader(otherAddresses[n]);
@@ -811,7 +809,7 @@ InitRecipients(Composer *cv,
    // mailing lists
    wxArrayInt addressesToIgnore,
               addressesList;
-   for ( n = 0; n < uniqueAddresses.GetCount(); n++ )
+   for ( size_t n = 0; n < uniqueAddresses.GetCount(); n++ )
    {
       const String& addr = uniqueAddresses[n];
 
@@ -866,7 +864,7 @@ InitRecipients(Composer *cv,
    }
 
    count = uniqueAddresses.GetCount();
-   for ( n = 0; n < count; n++ )
+   for ( size_t n = 0; n < count; n++ )
    {
       if ( addressesToIgnore.Index(n) != wxNOT_FOUND )
       {
@@ -917,7 +915,7 @@ InitRecipients(Composer *cv,
 
    // finally add all recipients in the composer in the reverse order -- so
    // that they appear there as we want them
-   n = rcptAddresses.GetCount();
+   size_t n = rcptAddresses.GetCount();
    CHECK_RET( rcptTypes.GetCount() == n, _T("logic error in InitRecipients") );
 
    while ( n-- )
diff --git a/src/mail/MailFolderCC.cpp b/src/mail/MailFolderCC.cpp
index b01fad7..9fbf817 100644
--- a/src/mail/MailFolderCC.cpp
+++ b/src/mail/MailFolderCC.cpp
@@ -3519,21 +3519,21 @@ MsgnoArray *MailFolderCC::SearchByFlag(MessageStatus flag,
    if ( last )
    {
       // only search among the messages after this one
-      SEARCHSET *set = mail_newsearchset();
-      set->first = last + 1;
+      SEARCHSET *sset = mail_newsearchset();
+      sset->first = last + 1;
 
       CHECK( m_MailStream, 0, _T("SearchByFlag: folder is closed") );
 
 
       if ( flags & SEARCH_UID )
       {
-         set->last = mail_uid(m_MailStream, m_nMessages);
-         pgm->uid = set;
+         sset->last = mail_uid(m_MailStream, m_nMessages);
+         pgm->uid = sset;
       }
       else // msgno search
       {
-         set->last = m_nMessages;
-         pgm->msgno = set;
+         sset->last = m_nMessages;
+         pgm->msgno = sset;
       }
    }
 
diff --git a/src/mail/SendMessageCC.cpp b/src/mail/SendMessageCC.cpp
index cc88344..b7d4e21 100644
--- a/src/mail/SendMessageCC.cpp
+++ b/src/mail/SendMessageCC.cpp
@@ -1562,8 +1562,7 @@ SendMessageCC::AddPart(MimeType::Primary type,
    bdy->contents.text.size = len;
 
 
-   PARAMETER *lastpar = NULL,
-             *par;
+   PARAMETER *lastpar = NULL;
 
    // do we already have CHARSET parameter?
    bool hasCharset = false;
@@ -1573,7 +1572,7 @@ SendMessageCC::AddPart(MimeType::Primary type,
       MessageParameterList::iterator i;
       for( i = plist->begin(); i != plist->end(); i++ )
       {
-         par = mail_newbody_parameter();
+         PARAMETER *par = mail_newbody_parameter();
 
          String name = i->name;
          if ( name.Lower() == "charset" )
@@ -1620,7 +1619,7 @@ SendMessageCC::AddPart(MimeType::Primary type,
 
       if ( !cs.empty() )
       {
-         par = mail_newbody_parameter();
+         PARAMETER *par = mail_newbody_parameter();
          par->attribute = strdup("CHARSET");
          par->value     = strdup(cs.ToAscii());
          par->next      = lastpar;
@@ -1633,13 +1632,12 @@ SendMessageCC::AddPart(MimeType::Primary type,
       bdy->disposition.type = strdup(disposition.ToAscii());
    if ( dlist )
    {
-      PARAMETER *lastpar = NULL,
-                *par;
+      lastpar = NULL;
 
       MessageParameterList::iterator i;
       for ( i = dlist->begin(); i != dlist->end(); i++ )
       {
-         par = mail_newbody_parameter();
+         PARAMETER *par = mail_newbody_parameter();
          par->attribute = strdup(i->name.ToAscii());
          par->value     = strdup(MIME::EncodeHeader(i->value));
          par->next      = NULL;
diff --git a/src/mail/ThreadJWZ.cpp b/src/mail/ThreadJWZ.cpp
index 4549f70..295ce59 100644
--- a/src/mail/ThreadJWZ.cpp
+++ b/src/mail/ThreadJWZ.cpp
@@ -552,12 +552,12 @@ StringList Threadable::messageThreadReferences() const
             // In case of duplicated reference we keep the last one:
             // It is important that In-Reply-To is the last reference
             // in the list.
-            StringList::iterator i;
-            for (i = tmp.begin(); i != tmp.end(); i++)
+            StringList::iterator it;
+            for (it = tmp.begin(); it != tmp.end(); it++)
             {
-               if (*i == ref)
+               if (*it == ref)
                {
-                  tmp.erase(i);
+                  tmp.erase(it);
                   break;
                }
             }
diff --git a/src/modules/Filters.cpp b/src/modules/Filters.cpp
index c86e0ee..f94ceb5 100644
--- a/src/modules/Filters.cpp
+++ b/src/modules/Filters.cpp
@@ -2130,8 +2130,8 @@ static Value func_istome(ArgList *args, FilterRuleImpl *p)
 
    if ( msg )
    {
-      String value;
-      if ( msg->GetHeaderLine(_T("List-Post"), value) )
+      String valueListPost;
+      if ( msg->GetHeaderLine(_T("List-Post"), valueListPost) )
       {
          return Value(true);
       }
diff --git a/src/modules/Migrate.cpp b/src/modules/Migrate.cpp
index 3b02cb3..95868e7 100644
--- a/src/modules/Migrate.cpp
+++ b/src/modules/Migrate.cpp
@@ -1190,9 +1190,9 @@ MigrateWizardConfirmPage::BuildMsg(MigrateWizard *parent) const
                 "server %s"),
               data.countFolders, data.source.server.c_str());
 
-   const String& root = data.source.root;
-   if ( !root.empty() )
-      msg += String::Format(_(" (under %s only)"), root.c_str());
+   const String& rootSrc = data.source.root;
+   if ( !rootSrc.empty() )
+      msg += String::Format(_(" (under %s only)"), rootSrc);
 
    msg += _T('\n');
 
@@ -1204,9 +1204,9 @@ MigrateWizardConfirmPage::BuildMsg(MigrateWizard *parent) const
                data.dstIMAP.server.c_str()
              );
 
-      const String& root = data.dstIMAP.root;
-      if ( !root.empty() )
-         msg += String::Format(_(" (under %s)"), root.c_str());
+      const String& rootDst = data.dstIMAP.root;
+      if ( !rootDst.empty() )
+         msg += String::Format(_(" (under %s)"), rootDst);
 
       msg += _T('\n');
    }
@@ -1708,7 +1708,6 @@ void MigrateWizardProgressPage::DoMigration()
       m_gaugeMsg->SetValue(m_countMessages);
       m_gaugeFolder->SetValue(Data().countFolders);
 
-      String msg;
       if ( m_nErrors )
       {
          wxLogError(_("There were errors during the migration."));
diff --git a/src/modules/crypt/PGPEngine.cpp b/src/modules/crypt/PGPEngine.cpp
index 0aa1f54..e068dba 100644
--- a/src/modules/crypt/PGPEngine.cpp
+++ b/src/modules/crypt/PGPEngine.cpp
@@ -614,10 +614,10 @@ PGPEngine::ExecCommand(const String& options,
                   { 10, "sha512" },
                };
 
-               String err;
+               String errmsg;
                if ( *pc++ != 'D' )
                {
-                  err.Printf(_("unexpected signature type '%c'"), pc[-1]);
+                  errmsg.Printf(_("unexpected signature type '%c'"), pc[-1]);
                }
                else
                {
@@ -627,8 +627,8 @@ PGPEngine::ExecCommand(const String& options,
                   unsigned long n;
                   if ( !pkalg.ToULong(&n) )
                   {
-                     err.Printf(_("unexpected public key algorithm \"%s\""),
-                                pkalg.c_str());
+                     errmsg.Printf(_("unexpected public key algorithm \"%s\""),
+                                   pkalg.c_str());
                   }
                   else
                   {
@@ -637,8 +637,8 @@ PGPEngine::ExecCommand(const String& options,
                      const String micalg(ReadNumber(pc));
                      if ( !micalg.ToULong(&n) )
                      {
-                        err.Printf(_("unexpected hash algorithm \"%s\""),
-                                   micalg.c_str());
+                        errmsg.Printf(_("unexpected hash algorithm \"%s\""),
+                                      micalg.c_str());
                      }
                      else
                      {
@@ -658,10 +658,10 @@ PGPEngine::ExecCommand(const String& options,
 
                         if ( !found )
                         {
-                           err.Printf(_("unsupported hash algorithm \"%s\", "
-                                        "please configure GPG to use a hash "
-                                        "algorithm compatible with RFC 3156"),
-                                      micalg.c_str());
+                           errmsg.Printf(_("unsupported hash algorithm \"%s\", "
+                                           "please configure GPG to use a hash "
+                                           "algorithm compatible with RFC 3156"),
+                                         micalg.c_str());
 
                            status = SIGN_UNKNOWN_MICALG;
                         }
@@ -669,13 +669,13 @@ PGPEngine::ExecCommand(const String& options,
                   }
                }
 
-               if ( !err.empty() )
+               if ( !errmsg.empty() )
                {
                   // don't overwrite a more specific error code if set above
                   if ( status != SIGN_UNKNOWN_MICALG )
                      status = SIGN_ERROR;
 
-                  wxLogError(_("Failed to sign message: %s"), err.c_str());
+                  wxLogError(_("Failed to sign message: %s"), errmsg);
                }
             }
             else if ( code == _T("BEGIN_SIGNING") )
diff --git a/src/util/upgrade.cpp b/src/util/upgrade.cpp
index 5c18103..dfd6283 100644
--- a/src/util/upgrade.cpp
+++ b/src/util/upgrade.cpp
@@ -1529,7 +1529,7 @@ static wxString GetRFC822Time(void)
 
 #ifdef USE_WIZARD
 static
-void CompleteConfiguration(const struct InstallWizardData &gs_installWizardData);
+void CompleteConfiguration();
 
 static void SetupServers(void);
 
@@ -1707,7 +1707,7 @@ bool RunInstallWizard(
       profile->writeEntry(MP_MOVE_NEWMAIL, false);
    }
 
-   CompleteConfiguration(gs_installWizardData);
+   CompleteConfiguration();
 
    String mainFolderName;
 #ifdef USE_INBOX
@@ -1799,7 +1799,7 @@ bool RunInstallWizard(
   as needed.
 */
 static
-void CompleteConfiguration(const struct InstallWizardData& gs_installWizardData)
+void CompleteConfiguration()
 {
    Profile *profile = mApplication->GetProfile();
 
@@ -1991,15 +1991,15 @@ CopyEntries(wxConfigBase *src,
                wxString val;
                if ( src->Read(entry, &val) )
                {
-                  bool ok;
+                  bool copiedOk;
                   long l;
                   if ( val.ToLong(&l) )
-                     ok = dest->Write(newentry, l);
+                     copiedOk = dest->Write(newentry, l);
                   else
-                     ok = dest->Write(newentry, val);
+                     copiedOk = dest->Write(newentry, val);
 
-                  if ( ok )
-                     numCopied++;
+                  if ( copiedOk )
+                     copiedOk++;
                }
             }
             break;
@@ -2105,8 +2105,7 @@ UpgradeFrom010()
    {
       if(mainFolder[0u] == '/')
       {
-         wxString tmp = mainFolder.Mid(1);
-         mainFolder = tmp;
+         mainFolder = mainFolder.Mid(1);
          p->writeEntry(MP_MAINFOLDER, mainFolder);
       }
    }

-----------------------------------------------------------------------

Summary of changes:
 include/MFrame.h                |    6 ++--
 include/PGPClickInfo.h          |    2 +-
 src/adb/AdbManager.cpp          |    7 ++--
 src/adb/Collect.cpp             |    6 ++--
 src/classes/ComposeTemplate.cpp |   12 +++---
 src/classes/MEvent.cpp          |    4 +-
 src/classes/MessageTemplate.cpp |   12 +++---
 src/classes/MessageView.cpp     |    9 ++---
 src/classes/PGPClickInfo.cpp    |    2 +-
 src/gui/ClickURL.cpp            |    2 +-
 src/gui/wxComposeView.cpp       |    9 ++---
 src/gui/wxFiltersDialog.cpp     |    6 ++--
 src/gui/wxFolderTree.cpp        |    1 -
 src/gui/wxFolderView.cpp        |   12 +++---
 src/gui/wxHeadersDialogs.cpp    |    6 ++--
 src/gui/wxIconManager.cpp       |    2 +-
 src/gui/wxMFrame.cpp            |    6 ++--
 src/gui/wxMIMETreeDialog.cpp    |    6 ++--
 src/gui/wxMainFrame.cpp         |    4 +-
 src/gui/wxMimeDialog.cpp        |    2 +-
 src/gui/wxMsgCmdProc.cpp        |   12 +++---
 src/mail/MailFolder.cpp         |   18 +++++------
 src/mail/MailFolderCC.cpp       |   12 +++---
 src/mail/MimePartVirtual.cpp    |    2 +-
 src/mail/SendMessageCC.cpp      |   12 +++----
 src/mail/ThreadJWZ.cpp          |    8 ++--
 src/modules/Filters.cpp         |    4 +-
 src/modules/Migrate.cpp         |   13 +++----
 src/modules/crypt/PGPEngine.cpp |   65 +++++++++++++++++++++++++++++---------
 src/util/upgrade.cpp            |   19 +++++------
 30 files changed, 151 insertions(+), 130 deletions(-)


hooks/post-receive
-- 
Mahogany sources repository.

------------------------------------------------------------------------------