aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wiki.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wiki.c b/wiki.c
index e764f2a..5f3af7e 100644
--- a/wiki.c
+++ b/wiki.c
@@ -50,8 +50,12 @@ void head(char *page, char *link, char *what) {
void foot(int file) {
printf("<hr>\n");
printf("<p>");
- for(int i = 0; *links[i]; i++)
- printf("<a href='%s/%s'>%s</a> ", script, links[i][1], links[i][0]);
+ for(int i = 0; *links[i]; i++) {
+ if(*links[i][1] == '/' || strstr(links[i][1], "://"))
+ printf("<a href='%s'>%s</a> ", links[i][1], links[i][0]);
+ else
+ printf("<a href='%s/%s'>%s</a> ", script, links[i][1], links[i][0]);
+ }
if(!file) return;
printf("<span style='float: right'>");
printf("%s ", id);