[gnome-control-center] Users: strip out periods when generating proposals



commit 13a08f499432365eb42a277ee6c304037e00cb78
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 23 09:19:19 2011 -0400

    Users: strip out periods when generating proposals
    
    Some systems seem to disallow them in usernames, but more
    importantly, the proposals look just wrong for abbreviated
    middle initials with a period.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650777

 panels/user-accounts/um-utils.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/panels/user-accounts/um-utils.c b/panels/user-accounts/um-utils.c
index b874ff4..f579cb7 100644
--- a/panels/user-accounts/um-utils.c
+++ b/panels/user-accounts/um-utils.c
@@ -557,14 +557,18 @@ generate_username_choices (const gchar  *name,
 
         lc_name = g_ascii_strdown (ascii_name, -1);
 
-        /* remove all non ASCII alphanumeric chars from the name,
-         * apart from the few allowed symbols
+        /* Remove all non ASCII alphanumeric chars from the name,
+         * apart from the few allowed symbols.
+         *
+         * We do remove '.', even though it is usually allowed,
+         * since it often comes in via an abbreviated middle name,
+         * and the dot looks just wrong in the proposals then.
          */
         stripped_name = g_strnfill (strlen (lc_name) + 1, '\0');
         i = 0;
         for (c = lc_name; *c; c++) {
                 if (!(g_ascii_isdigit (*c) || g_ascii_islower (*c) ||
-                    *c == ' ' || *c == '-' || *c == '.' || *c == '_' ||
+                    *c == ' ' || *c == '-' || *c == '_' ||
                     /* used to track invalid words, removed below */
                     *c == '?') )
                         continue;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]