diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-17 10:07:39 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:15:06 +0100 |
commit | 22342055700384118a6af62b7292a974f526613a (patch) | |
tree | 7f2446d7e55f75f511f70ed12093f9889f4770fc | |
parent | c89fd703bbff17fe9f703db444981f70c0b6aa4b (diff) |
libmm-common: allow empty strings passed to the key value parser
-rw-r--r-- | libmm-common/mm-common-helpers.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libmm-common/mm-common-helpers.c b/libmm-common/mm-common-helpers.c index 98f85bc5..422f954d 100644 --- a/libmm-common/mm-common-helpers.c +++ b/libmm-common/mm-common-helpers.c @@ -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) { |