Revision: 7342
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7342&view=rev
Author:   vadz
Date:     2007-08-26 04:39:26 -0700 (Sun, 26 Aug 2007)

Log Message:
-----------
strip trailing commas from gecos

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

Modified: trunk/M/src/adb/ProvPasswd.cpp
===================================================================
--- trunk/M/src/adb/ProvPasswd.cpp      2007-08-26 11:33:38 UTC (rev 7341)
+++ trunk/M/src/adb/ProvPasswd.cpp      2007-08-26 11:39:26 UTC (rev 7342)
@@ -318,7 +318,14 @@
    while ( (pwd = getpwent()) != NULL )
    {
       size_t index = m_names.Add(wxConvertMB2WX(pwd->pw_name));
-      m_gecos.Insert(wxConvertMB2WX(pwd->pw_gecos), index);
+
+      // at least under Linux gecos fields of the password database often have
+      // trailing commas to indicate missing fields but we don't want to use
+      // them as part of "real name"
+      wxString gecos(wxConvertMB2WX(pwd->pw_gecos));
+      gecos.EndsWith(",,,", &gecos);
+
+      m_gecos.Insert(gecos, index);
    }
 
    endpwent();


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to