aboutsummaryrefslogtreecommitdiff
path: root/wiki.c
diff options
context:
space:
mode:
authorthe little girl <yui@blekksprut.net>2014-04-14 21:53:09 +0200
committerthe little girl <yui@blekksprut.net>2014-04-14 21:53:09 +0200
commit4cf2bb5092906bd9e4e689999c1729e37b4abd18 (patch)
tree30539f838ef6a800473d3fab6f8063b4e1ef9f52 /wiki.c
parent1d0185b3d20a3c530597f5de03059a161107aedc (diff)
downloadukulele-4cf2bb5092906bd9e4e689999c1729e37b4abd18.tar.xz
mulighet for absolutte linker nederst
Diffstat (limited to 'wiki.c')
-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);