SF.net SVN: mahogany:[7544] trunk/M/src/adb/AdbManager.cpp

[email protected] Wed, 13 Aug 2008 23:08:26 +0000
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
Revision: 7544
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7544&view=rev
Author:   vadz
Date:     2008-08-13 23:08:24 +0000 (Wed, 13 Aug 2008)

Log Message:
-----------
fix expansion of already expanded address with non-ASCII characters

Modified Paths:
--------------
    trunk/M/src/adb/AdbManager.cpp

Modified: trunk/M/src/adb/AdbManager.cpp
===================================================================
--- trunk/M/src/adb/AdbManager.cpp	2008-08-08 00:22:10 UTC (rev 7543)
+++ trunk/M/src/adb/AdbManager.cpp	2008-08-13 23:08:24 UTC (rev 7544)
@@ -405,12 +405,12 @@
       // address assume that it doesn't need to be expanded (this saves a lot
       // of time as expanding a non existing address looks through all address
       // books...)
-      size_t pos = textOrig.find('@');
-      if ( pos != String::npos && pos > 0 && pos < textOrig.length() )
+      const size_t posAt = textOrig.find('@');
+      if ( posAt != String::npos )
       {
          // also check that the host part of the address is expanded - it
          // should contain at least one dot normally
-         if ( wxStrchr(textOrig.c_str() + pos + 1, '.') )
+         if ( textOrig.find('.', posAt + 1) != String::npos )
          {
             // looks like a valid address - nothing to do
             newText = textOrig;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/