~mdw
/
sgt
/
agedu
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare to have a parametrisable path separator character. Currently
[sgt/agedu]
/
html.c
diff --git
a/html.c
b/html.c
index
47e4372
..
1daabe6
100644
(file)
--- a/
html.c
+++ b/
html.c
@@
-20,6
+20,8
@@
#define MAXCOLOUR 511
#define MAXCOLOUR 511
+extern char pathsep;
+
struct html {
char *buf;
size_t buflen, bufsize;
struct html {
char *buf;
size_t buflen, bufsize;
@@
-442,7
+444,7
@@
char *html_query(const void *t, unsigned long index,
*/
htprintf(ctx, "<p align=center>\n<code>");
q = path;
*/
htprintf(ctx, "<p align=center>\n<code>");
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,
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, "<a href=\"%s\">", href);
doing_href = 1;
}
htprintf(ctx, "<a href=\"%s\">", href);
doing_href = 1;
}
- *p =
'/'
;
+ *p =
pathsep
;
htescape(ctx, q, p - q, 1);
q = p + 1;
if (doing_href)
htprintf(ctx, "</a>");
htescape(ctx, q, p - q, 1);
q = p + 1;
if (doing_href)
htprintf(ctx, "</a>");
- ht
printf(ctx, "/"
);
+ ht
escape(ctx, q, p - q, 1
);
}
htescape(ctx, q, strlen(q), 1);
htprintf(ctx, "</code>\n");
}
htescape(ctx, q, strlen(q), 1);
htprintf(ctx, "</code>\n");