diff options
-rw-r--r-- | wiki.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |