]> gitweb.ps.run Git - ps-cgit/blobdiff - html.c
forms: action should not be empty
[ps-cgit] / html.c
diff --git a/html.c b/html.c
index a47cff07154d5701a7c84774ac68feb33337ee39..d89df3ae35e219fedaf28b4f61820c695af234f9 100644 (file)
--- a/html.c
+++ b/html.c
@@ -121,13 +121,6 @@ void html_vtxtf(const char *format, va_list ap)
        strbuf_release(&buf);
 }
 
-void html_status(int code, const char *msg, int more_headers)
-{
-       htmlf("Status: %d %s\n", code, msg);
-       if (!more_headers)
-               html("\n");
-}
-
 void html_txt(const char *txt)
 {
        const char *t = txt;
@@ -246,6 +239,32 @@ void html_url_arg(const char *txt)
                html(txt);
 }
 
+void html_header_arg_in_quotes(const char *txt)
+{
+       const char *t = txt;
+       while (t && *t) {
+               unsigned char c = *t;
+               const char *e = NULL;
+               if (c == '\\')
+                       e = "\\\\";
+               else if (c == '\r')
+                       e = "\\r";
+               else if (c == '\n')
+                       e = "\\n";
+               else if (c == '"')
+                       e = "\\\"";
+               if (e) {
+                       html_raw(txt, t - txt);
+                       html(e);
+                       txt = t + 1;
+               }
+               t++;
+       }
+       if (t != txt)
+               html(txt);
+
+}
+
 void html_hidden(const char *name, const char *value)
 {
        html("<input type='hidden' name='");