mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
glocalfileinfo: Use g_strcmp0() for some comparisons which might be NULL
The return value from g_get_user_special_dir() might be NULL. Safest to use g_strcmp0() uniformly everywhere. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=661442
This commit is contained in:
parent
9cbff9f768
commit
0a10f7375f
@ -1618,12 +1618,12 @@ get_icon_name (const char *path,
|
|||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
gboolean with_fallbacks = TRUE;
|
gboolean with_fallbacks = TRUE;
|
||||||
|
|
||||||
if (strcmp (path, g_get_home_dir ()) == 0)
|
if (g_strcmp0 (path, g_get_home_dir ()) == 0)
|
||||||
{
|
{
|
||||||
name = use_symbolic ? "user-home-symbolic" : "user-home";
|
name = use_symbolic ? "user-home-symbolic" : "user-home";
|
||||||
with_fallbacks = FALSE;
|
with_fallbacks = FALSE;
|
||||||
}
|
}
|
||||||
else if (strcmp (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0)
|
else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0)
|
||||||
{
|
{
|
||||||
name = use_symbolic ? "user-desktop-symbolic" : "user-desktop";
|
name = use_symbolic ? "user-desktop-symbolic" : "user-desktop";
|
||||||
with_fallbacks = FALSE;
|
with_fallbacks = FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user