After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 544376 - The default value for the name entry in the high scores is always empty
The default value for the name entry in the high scores is always empty
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: gnome-2-24
Assigned To: gnome-games-general-maint
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-23 16:05 UTC by Josselin Mouette
Modified: 2008-10-10 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fall back to g_get_user_name (Morita Sho) (726 bytes, patch)
2008-07-23 16:07 UTC, Josselin Mouette
none Details | Review
Fall back to g_get_user_name with utf-8 validation (735 bytes, patch)
2008-07-24 11:41 UTC, Morita Sho
committed Details | Review

Description Josselin Mouette 2008-07-23 16:05:59 UTC
[ Forwarded from http://bugs.debian.org/490224 by Morita Sho ]

The default value for the name entry in the high scores is always empty for me.

It seems that the problem is gnome games get the user name using g_get_real_name() function.
Unfortunately, g_get_real_name() returns empty string when the 5th field of passwd entry is empty.

It would be great if gnome games get the user name using g_get_user_name() when
g_get_real_name() returned empty string.
Comment 1 Josselin Mouette 2008-07-23 16:07:08 UTC
Created attachment 115099 [details] [review]
Fall back to g_get_user_name (Morita Sho)
Comment 2 Christian Persch 2008-07-23 22:31:24 UTC
The patch isn't correct since g_get_user_name may not return UTF-8, see bug 542058.
Comment 3 Morita Sho 2008-07-24 11:24:51 UTC
Oh, I see. Thank you for pointed out.

I'd like to correct my patch, but I'm not sure what should I do...
Hmm. Should I validate a string returned by g_get_user_name() using g_utf8_validate() ?

Regards,
Comment 4 Morita Sho 2008-07-24 11:41:33 UTC
Created attachment 115162 [details] [review]
Fall back to g_get_user_name with utf-8 validation

I have made a new patch.
In this patch, I added the utf-8 validation for the name.
If the name is not a valid utf-8 string, then fall back to empty string.
Comment 5 Thomas Andersen 2008-10-10 14:43:25 UTC
Committed to trunk in r7997. The patch will be in 2.25.1. Thanks Morita!