GNOME Bugzilla – Bug 544376
The default value for the name entry in the high scores is always empty
Last modified: 2008-10-10 14:43:25 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.
Created attachment 115099 [details] [review] Fall back to g_get_user_name (Morita Sho)
The patch isn't correct since g_get_user_name may not return UTF-8, see bug 542058.
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,
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.
Committed to trunk in r7997. The patch will be in 2.25.1. Thanks Morita!