diff options
Diffstat (limited to '')
-rw-r--r-- | src/httpd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/httpd.c b/src/httpd.c index bf5c3d1..656ad92 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -9,13 +9,17 @@ char * sc_queryhtml (struct sc_query * q) { /* remember to free returned string string##_sizeof = (string##_written+wanted+1)*SC_REALLOC_K; \ string = realloc(string, string##_sizeof); \ } -#define SC_HRF "<div class=result><h4><a href=\"%s\">%s</a></h4><p>%s</p></div>" +#define SC_HRF "<div class=result id=result%lu><h4><a href=\"%s\" accesskey=%lu>%s</a> " \ + "<span class=breadcrumb>%s</span></h4><p>%s</p></div>" +#define SC_HRA i, safeurl, i, safetitle, safebreadcrumbs, safebody char * safetitle = htmlspecialchars(q->results[i]->title); char * safebody = htmlspecialchars(q->results[i]->desc); char * safeurl = htmlspecialchars(q->results[i]->url); - size_t ws = snprintf(NULL, 0, SC_HRF, safeurl, safetitle, safebody); + char * safebreadcrumbs = htmlspecialchars(q->results[i]->breadcrumbs); + size_t ws = snprintf(NULL, 0, SC_HRF, SC_HRA); SC_HRC(resultshtml, ws); - resultshtml_written += sprintf(resultshtml+resultshtml_written, SC_HRF, safeurl, safetitle, safebody); + resultshtml_written += sprintf(resultshtml+resultshtml_written, SC_HRF, SC_HRA); + free(safebreadcrumbs); free(safetitle); free(safebody); free(safeurl); |