diff options
author | Christian Fetzer <christian.fetzer@bmw-carit.de> | 2013-09-24 16:16:07 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-10-03 16:46:41 +0300 |
commit | 8b6966a72f92d3081ad57cc878125d9ace404a72 (patch) | |
tree | 4a4459c26ca403a9bf62a3e23e181cce6c670fa3 /obexd | |
parent | c55ebae4311dd4a4e5d2a019ca6befee3ea30b97 (diff) |
obexd: Prefix folders in event reports with leading slash
The internal representation of folder paths starts with a leading slash.
Therefore we have to prepend it to the folders received in event reports.
Diffstat (limited to 'obexd')
-rw-r--r-- | obexd/client/mns.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/obexd/client/mns.c b/obexd/client/mns.c index 76a5e24e2..ca44e5f1e 100644 --- a/obexd/client/mns.c +++ b/obexd/client/mns.c @@ -188,13 +188,25 @@ static void parse_event_report_handle(struct map_event *event, static void parse_event_report_folder(struct map_event *event, const char *value) { - event->folder = g_strdup(value); + if (!value) + return; + + if (g_str_has_prefix(value, "/")) + event->folder = g_strdup(value); + else + event->folder = g_strconcat("/", value, NULL); } static void parse_event_report_old_folder(struct map_event *event, const char *value) { - event->old_folder = g_strdup(value); + if (!value) + return; + + if (g_str_has_prefix(value, "/")) + event->old_folder = g_strdup(value); + else + event->old_folder = g_strconcat("/", value, NULL); } static void parse_event_report_msg_type(struct map_event *event, |