[PATCH 7/7] obexd: Prefix folders in event reports with leading slash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Fetzer <christian.fetzer@xxxxxxxxxxxx>

The internal representation of folder paths starts with a leading slash.
Therefore we have to prepend it to the folders received in event reports.
---
 obexd/client/mns.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 76a5e24..ca44e5f 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,
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux