X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/1e8d78b987550c351f47b204d3c9649cc1872e45..373a02e53778079f10f67bd33a948c4f6f2be6da:/html.c diff --git a/html.c b/html.c index 47e4372..1daabe6 100644 --- a/html.c +++ b/html.c @@ -20,6 +20,8 @@ #define MAXCOLOUR 511 +extern char pathsep; + struct html { char *buf; size_t buflen, bufsize; @@ -442,7 +444,7 @@ char *html_query(const void *t, unsigned long index, */ htprintf(ctx, "
\n");
q = path;
- for (p = strchr(path, '/'); p; p = strchr(p+1, '/')) {
+ for (p = strchr(path, pathsep); p; p = strchr(p+1, pathsep)) {
int doing_href = 0;
/*
* See if this path prefix exists in the trie. If so,
@@ -456,12 +458,12 @@ char *html_query(const void *t, unsigned long index,
htprintf(ctx, "", href);
doing_href = 1;
}
- *p = '/';
+ *p = pathsep;
htescape(ctx, q, p - q, 1);
q = p + 1;
if (doing_href)
htprintf(ctx, "");
- htprintf(ctx, "/");
+ htescape(ctx, q, p - q, 1);
}
htescape(ctx, q, strlen(q), 1);
htprintf(ctx, "
\n");