]> git.cameronkatri.com Git - cgit.git/blobdiff - html.c
Use mode 0644 for non-executable files
[cgit.git] / html.c
diff --git a/html.c b/html.c
index 36e9a2faf22c49580f5660493320b370b2d654b9..d7d9fd7007ff764c17ead46f23f00eaf44ade142 100644 (file)
--- a/html.c
+++ b/html.c
@@ -128,6 +128,38 @@ void html_attr(char *txt)
                html(txt);
 }
 
+void html_url_path(char *txt)
+{
+       char *t = txt;
+       while(t && *t){
+               int c = *t;
+               if (c=='"' || c=='#' || c=='\'' || c=='?') {
+                       write(htmlfd, txt, t - txt);
+                       write(htmlfd, fmt("%%%2x", c), 3);
+                       txt = t+1;
+               }
+               t++;
+       }
+       if (t!=txt)
+               html(txt);
+}
+
+void html_url_arg(char *txt)
+{
+       char *t = txt;
+       while(t && *t){
+               int c = *t;
+               if (c=='"' || c=='#' || c=='%' || c=='&' || c=='\'' || c=='+' || c=='?') {
+                       write(htmlfd, txt, t - txt);
+                       write(htmlfd, fmt("%%%2x", c), 3);
+                       txt = t+1;
+               }
+               t++;
+       }
+       if (t!=txt)
+               html(txt);
+}
+
 void html_hidden(char *name, char *value)
 {
        html("<input type='hidden' name='");