Fossil SCM

one more similar fix, in xhref(). There is only one hyperlink using xhref with ampersands, in the "vinfo" and "ci" pages, but just for completeness…

jan.nijtmans 2012-11-08 12:04 UTC ticket-5ff2043c96
Commit e47d862a59c2548747c1c2122be5f5cc2b92ccce
1 file changed +4 -1
+4 -1
--- src/style.c
+++ src/style.c
@@ -90,11 +90,14 @@
9090
va_list ap;
9191
va_start(ap, zFormat);
9292
zUrl = vmprintf(zFormat, ap);
9393
va_end(ap);
9494
if( g.perm.Hyperlink && !g.javascriptHyperlink ){
95
- return mprintf("<a %s href=\"%z\">", zExtra, zUrl);
95
+ char *link = htmlize(zUrl, strlen(zUrl));
96
+ zUrl = mprintf("<a %s href=\"%z\">", zExtra, link);
97
+ fossil_free(link);
98
+ return zUrl;
9699
}
97100
if( nHref>=nHrefAlloc ){
98101
nHrefAlloc = nHrefAlloc*2 + 10;
99102
aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
100103
}
101104
--- src/style.c
+++ src/style.c
@@ -90,11 +90,14 @@
90 va_list ap;
91 va_start(ap, zFormat);
92 zUrl = vmprintf(zFormat, ap);
93 va_end(ap);
94 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
95 return mprintf("<a %s href=\"%z\">", zExtra, zUrl);
 
 
 
96 }
97 if( nHref>=nHrefAlloc ){
98 nHrefAlloc = nHrefAlloc*2 + 10;
99 aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
100 }
101
--- src/style.c
+++ src/style.c
@@ -90,11 +90,14 @@
90 va_list ap;
91 va_start(ap, zFormat);
92 zUrl = vmprintf(zFormat, ap);
93 va_end(ap);
94 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
95 char *link = htmlize(zUrl, strlen(zUrl));
96 zUrl = mprintf("<a %s href=\"%z\">", zExtra, link);
97 fossil_free(link);
98 return zUrl;
99 }
100 if( nHref>=nHrefAlloc ){
101 nHrefAlloc = nHrefAlloc*2 + 10;
102 aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
103 }
104

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button