mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 15:20:08 +01:00
shared: add nm_dbus_path_not_empty() helper
This commit is contained in:
parent
9b2d5742c1
commit
15fe8ad851
1 changed files with 11 additions and 0 deletions
|
|
@ -1268,6 +1268,17 @@ nm_clear_g_cancellable_disconnect (GCancellable *cancellable, gulong *cancellabl
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline const char *
|
||||
nm_dbus_path_not_empty (const char *str)
|
||||
{
|
||||
nm_assert (!str || str[0] == '/');
|
||||
return !str || (str[0] == '/' && str[1] == '\0')
|
||||
? NULL
|
||||
: str;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* GVariantType is basically a C string. But G_VARIANT_TYPE() is not suitable
|
||||
* to initialize a static variable (because it evaluates a function check that
|
||||
* the string is valid). Add an alternative macro that does the plain cast.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue