]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'stable'
authorLars Hjemli <hjemli@gmail.com>
Sat, 23 Feb 2008 19:13:57 +0000 (20:13 +0100)
committerLars Hjemli <hjemli@gmail.com>
Sat, 23 Feb 2008 19:14:01 +0000 (20:14 +0100)
* stable:
  Fix segfault

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
1  2 
html.c

diff --combined html.c
index eb163d9d1f3a249feb36ee155ab5a464ef4aa64a,d531c209f2502ab43ceb36c749c69b7f4a93c3b1..339bf0043aceafae6cd5894046c9e676742432b3
--- 1/html.c
--- 2/html.c
+++ b/html.c
@@@ -48,9 -48,7 +48,7 @@@ void html_txt(char *txt
        while(t && *t){
                int c = *t;
                if (c=='<' || c=='>' || c=='&') {
-                       *t = '\0';
-                       html(txt);
-                       *t = c;
+                       write(htmlfd, txt, t - txt);
                        if (c=='>')
                                html("&gt;");
                        else if (c=='<')
@@@ -71,9 -69,7 +69,7 @@@ void html_ntxt(int len, char *txt
        while(t && *t && len--){
                int c = *t;
                if (c=='<' || c=='>' || c=='&') {
-                       *t = '\0';
-                       html(txt);
-                       *t = c;
+                       write(htmlfd, txt, t - txt);
                        if (c=='>')
                                html("&gt;");
                        else if (c=='<')
                }
                t++;
        }
-       if (t!=txt) {
-               char c = *t;
-               *t = '\0';
-               html(txt);
-               *t = c;
-       }
+       if (t!=txt)
+               write(htmlfd, txt, t - txt);
        if (len<0)
                html("...");
  }
@@@ -100,9 -92,7 +92,7 @@@ void html_attr(char *txt
        while(t && *t){
                int c = *t;
                if (c=='<' || c=='>' || c=='\'') {
-                       *t = '\0';
-                       html(txt);
-                       *t = c;
+                       write(htmlfd, txt, t - txt);
                        if (c=='>')
                                html("&gt;");
                        else if (c=='<')
@@@ -132,7 -122,7 +122,7 @@@ void html_option(char *value, char *tex
        html_attr(value);
        html("'");
        if (selected_value && !strcmp(selected_value, value))
 -              html(" selected");
 +              html(" selected='selected'");
        html(">");
        html_txt(text);
        html("</option>\n");