[riot-notifications] [RIOT-OS/RIOT] uri_parser: provide function to split query (#16695)

benpicco notifications at github.com
Wed Aug 4 12:06:40 CEST 2021


@benpicco commented on this pull request.



> +            case '&':
+                if (params[idx].value == NULL) {
+                    /* we should have picked up a parameter value by now */
+                    return -1;
+                }
+                params[idx].value_len = c - params[idx].value;
+                if (*c == '#') {
+                    /* we've reached the end of the query string, next comes an
+                     * anchor, enforce end of loop
+                     * XXX: can be removed when uri_parser has anchor support */
+                    c = query_end;
+                }
+                else if ((idx + 1) < params_len) {
+                    /* c is an ampersand (&), so mark the next char as the next
+                     * parameter's name name */
+                    params[++idx].name = (char *)c + 1U;

If you are not including the patch in this PR I will open a PR with this patch later :wink: 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16695#discussion_r682476018
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210804/f1576a4a/attachment-0001.htm>


More information about the notifications mailing list