summaryrefslogtreecommitdiffabout
path: root/html.c
Side-by-side diff
Diffstat (limited to 'html.c') (more/less context) (ignore whitespace changes)
-rw-r--r--html.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/html.c b/html.c
index 6c9cc8b..eb163d9 100644
--- a/html.c
+++ b/html.c
@@ -87,97 +87,97 @@ void html_ntxt(int len, char *txt)
if (t!=txt) {
char c = *t;
*t = '\0';
html(txt);
*t = c;
}
if (len<0)
html("...");
}
void html_attr(char *txt)
{
char *t = txt;
while(t && *t){
int c = *t;
if (c=='<' || c=='>' || c=='\'') {
*t = '\0';
html(txt);
*t = c;
if (c=='>')
html("&gt;");
else if (c=='<')
html("&lt;");
else if (c=='\'')
html("&quote;");
txt = t+1;
}
t++;
}
if (t!=txt)
html(txt);
}
void html_hidden(char *name, char *value)
{
html("<input type='hidden' name='");
html_attr(name);
html("' value='");
html_attr(value);
html("'/>");
}
void html_option(char *value, char *text, char *selected_value)
{
html("<option value='");
html_attr(value);
html("'");
if (selected_value && !strcmp(selected_value, value))
- html(" selected");
+ html(" selected='selected'");
html(">");
html_txt(text);
html("</option>\n");
}
void html_link_open(char *url, char *title, char *class)
{
html("<a href='");
html_attr(url);
if (title) {
html("' title='");
html_attr(title);
}
if (class) {
html("' class='");
html_attr(class);
}
html("'>");
}
void html_link_close(void)
{
html("</a>");
}
void html_fileperm(unsigned short mode)
{
htmlf("%c%c%c", (mode & 4 ? 'r' : '-'),
(mode & 2 ? 'w' : '-'), (mode & 1 ? 'x' : '-'));
}
void html_filemode(unsigned short mode)
{
if (S_ISDIR(mode))
html("d");
else if (S_ISLNK(mode))
html("l");
else if (S_ISGITLINK(mode))
html("m");
else
html("-");
html_fileperm(mode >> 6);
html_fileperm(mode >> 3);
html_fileperm(mode);
}
int html_include(const char *filename)
{