url_text = memory_pool_alloc (task->task_pool, len + 1);
g_strlcpy (url_text, c, len + 1);
- g_strstrip (url_text);
decode_entitles (url_text);
url = memory_pool_alloc (task->task_pool, sizeof (struct uri));
rc = parse_uri (url, url_text, task->task_pool);
*t = '\0';
}
+static void
+url_strip (char *s)
+{
+ char *t = s; /* t - tortoise */
+ char *h = s; /* h - hare */
+
+ while (*h) {
+ if (g_ascii_isgraph (*h)) {
+ *t = *h;
+ t ++;
+ }
+ h++;
+ }
+ *t = '\0';
+}
+
/* The core of url_escape_* functions. Escapes the characters that
match the provided mask in urlchr_table.
if (strchr (uri->host, '%')) {
uri->hostlen = url_calculate_escaped_hostlen (uri->host, uri->hostlen);
}
+
+ url_strip (struri (uri));
url_unescape (uri->host);
path_simplify (uri->data);