From c1452c3707af4735ac0e06470c331b566f6e8898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20P=C3=B6tsch?= Date: Thu, 22 Nov 2012 13:47:55 +0100 Subject: [PATCH] fixed query filter for href attribute with leading "/" --- resource.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resource.c b/resource.c index 57545f11..5df91d7f 100644 --- a/resource.c +++ b/resource.c @@ -140,6 +140,11 @@ print_wellknown(coap_context_t *context, unsigned char *buf, size_t *buflen, query_pattern.length = COAP_OPT_LENGTH(query_filter) - (resource_param.length + 1); + if ((query_pattern.s[0] == '/') && ((flags & MATCH_URI) == MATCH_URI)) { + query_pattern.s++; + query_pattern.length--; + } + if (query_pattern.length && query_pattern.s[query_pattern.length-1] == '*') { query_pattern.length--;