[Xfce4-commits] [apps/xfce4-screensaver] 300/425: Bug Fix: g_get_real_name will never return NULL pointer

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:52:27 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit 14db5d0087d5b519adb87abaa3f4825a448d88a8
Author: Hao Lee <haolee.swjtu at gmail.com>
Date:   Tue Apr 11 20:58:49 2017 +0800

    Bug Fix: g_get_real_name will never return NULL pointer
    
    The function g_get_real_name is used to get user's full name, but when the full
    name is not existed, it will return an empty string instead of NULL.
---
 src/gs-lock-plug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index 99fc547..4069b11 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -1595,7 +1595,8 @@ get_user_display_name (void)
 
 	name = g_get_real_name ();
 
-	if (name == NULL || strcmp (name, "Unknown") == 0)
+	if (name == NULL || g_strcmp0 (name, "") == 0 ||
+	    g_strcmp0 (name, "Unknown") == 0)
 	{
 		name = g_get_user_name ();
 	}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list