Commit 7ffd705c authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Cut after the comma in the gecos field if there is more then one comma as


Fri May 28 12:01:02 2004  George Lebl <jirka@5z.com>

	* gui/gdmlogin.c, gui/greeter/greeter_item_ulist.c: Cut after
	  the comma in the gecos field if there is more then one comma
	  as then it's probably ugly arguments and not the name.  Fixes
	  #142274
parent eb9d2552
Fri May 28 12:01:02 2004 George Lebl <jirka@5z.com>
* gui/gdmlogin.c, gui/greeter/greeter_item_ulist.c: Cut after
the comma in the gecos field if there is more then one comma
as then it's probably ugly arguments and not the name. Fixes
#142274
Fri May 28 11:43:41 2004 George Lebl <jirka@5z.com>
* gui/greeter/greeter_action_language.c: Apply patch from
......
......@@ -3160,6 +3160,7 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
gchar buf[PIPE_SIZE];
size_t size;
int bufsize;
char *p;
user = g_new0 (GdmLoginUser, 1);
......@@ -3169,6 +3170,18 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
user->gecos = ve_locale_to_utf8 (gecos);
else
user->gecos = g_strdup (gecos);
/* Cut up to first comma since those are ugly arguments and
* not the name anymore, but only if more then 1 comma is found,
* since otherwise it might be part of the actual comment,
* this is sort of "heurestic" because there seems to be no
* real standard, it's all optional */
p = strchr (user->gecos, ',');
if (p != NULL) {
if (strchr (p+1, ',') != NULL)
*p = '\0';
}
user->homedir = g_strdup (homedir);
if (defface != NULL)
user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));
......@@ -3390,7 +3403,7 @@ gdm_login_users_init (void)
user = gdm_login_user_alloc(pwent->pw_name,
pwent->pw_uid,
pwent->pw_dir,
pwent->pw_gecos);
ve_sure_string (pwent->pw_gecos));
if ((user) &&
(! g_list_find_custom (users, user, (GCompareFunc) gdm_login_sort_func))) {
......
......@@ -57,6 +57,7 @@ gdm_greeter_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
gchar buf[PIPE_SIZE];
size_t size;
int bufsize;
char *p;
user = g_new0 (GdmGreeterUser, 1);
......@@ -66,6 +67,18 @@ gdm_greeter_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
user->gecos = ve_locale_to_utf8 (gecos);
else
user->gecos = g_strdup (gecos);
/* Cut up to first comma since those are ugly arguments and
* not the name anymore, but only if more then 1 comma is found,
* since otherwise it might be part of the actual comment,
* this is sort of "heurestic" because there seems to be no
* real standard, it's all optional */
p = strchr (user->gecos, ',');
if (p != NULL) {
if (strchr (p+1, ',') != NULL)
*p = '\0';
}
user->homedir = g_strdup (homedir);
if (defface != NULL)
user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));
......@@ -295,7 +308,7 @@ gdm_greeter_users_init (void)
user = gdm_greeter_user_alloc (pwent->pw_name,
pwent->pw_uid,
pwent->pw_dir,
pwent->pw_gecos);
ve_sure_string (pwent->pw_gecos));
if ((user) && (! g_list_find_custom (users, user,
(GCompareFunc) gdm_greeter_sort_func))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment