static void splitout_queryargs(request_rec *r, int qsappend)
{
char *q;
- char *olduri;
/* don't touch, unless it's an http or mailto URL.
* See RFC 1738 and RFC 2368.
return;
}
- q = strchr(r->filename, '?');
+ q = ap_strchr(r->filename, '?');
if (q != NULL) {
+ char *olduri;
+ apr_size_t len;
+
olduri = apr_pstrdup(r->pool, r->filename);
*q++ = '\0';
if (qsappend) {
else {
r->args = apr_pstrdup(r->pool, q);
}
- if (strlen(r->args) == 0) {
+
+ len = strlen(r->args);
+ if (!len) {
r->args = NULL;
- rewritelog(r, 3, "split uri=%s -> uri=%s, args=<none>", olduri,
- r->filename);
}
- else {
- if (r->args[strlen(r->args)-1] == '&') {
- r->args[strlen(r->args)-1] = '\0';
- }
- rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri,
- r->filename, r->args);
+ else if (r->args[len-1] == '&') {
+ r->args[len-1] = '\0';
}
+
+ rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri,
+ r->filename, r->args ? r->args : "<none>");
}
return;
r->filename = apr_pstrdup(r->pool, url);
}
}
+
return;
}