diff options
Diffstat (limited to 'libnet/http.c')
-rw-r--r-- | libnet/http.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libnet/http.c b/libnet/http.c index 8cd0f31..96dcd4d 100644 --- a/libnet/http.c +++ b/libnet/http.c @@ -65,3 +65,25 @@ char *http_query_get(const char *url, const char *path) strcat(query, "\r\n\r\n"); return query; } + +char *http_query_path(const char *query, char *path) +{ + u8 b = 0; + u32 s = 0; + u32 e = 0; + + while (1) { + if (!b && query[e] == ' ' && query[++e]) { + s = e; + b = 1; + } else if (b && query[e] == ' ') { + strncat(path, &query[s], e - s); + break; + } else if (query[e] == '\0') { + return NULL; + } + e++; + } + + return path; +} |