libmm-common: allow empty strings passed to the key value parser

This commit is contained in:
Aleksander Morgado
2012-03-15 14:15:06 +01:00
parent c89fd703bb
commit 2234205570
+6 -1
View File
@@ -333,8 +333,13 @@ mm_common_parse_key_value_string (const gchar *str,
g_return_val_if_fail (callback != NULL, FALSE);
g_return_val_if_fail (str != NULL, FALSE);
dup = g_strdup (str);
/* Allow empty strings, we'll just return with success */
while (g_ascii_isspace (*str))
str++;
if (!str[0])
return TRUE;
dup = g_strdup (str);
p = dup;
while (TRUE) {