| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: dir-index-bozo.c,v 1.36 2022/05/18 00:37:11 mrg Exp $ */ | | 1 | /* $NetBSD: dir-index-bozo.c,v 1.37 2024/04/26 20:27:12 maya Exp $ */ |
2 | | | 2 | |
3 | /* $eterna: dir-index-bozo.c,v 1.20 2011/11/18 09:21:15 mrg Exp $ */ | | 3 | /* $eterna: dir-index-bozo.c,v 1.20 2011/11/18 09:21:15 mrg Exp $ */ |
4 | | | 4 | |
5 | /* | | 5 | /* |
6 | * Copyright (c) 1997-2022 Matthew R. Green | | 6 | * Copyright (c) 1997-2022 Matthew R. Green |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -113,26 +113,27 @@ bozo_dir_index(bozo_httpreq_t *request, | | | @@ -113,26 +113,27 @@ bozo_dir_index(bozo_httpreq_t *request, |
113 | if (strcmp(printname, httpd->index_html) == 0) | | 113 | if (strcmp(printname, httpd->index_html) == 0) |
114 | strcpy(printname, "/"); /* is ``slashdir'' */ | | 114 | strcpy(printname, "/"); /* is ``slashdir'' */ |
115 | else | | 115 | else |
116 | *p = '\0'; /* strip unwanted ``index_html'' */ | | 116 | *p = '\0'; /* strip unwanted ``index_html'' */ |
117 | } | | 117 | } |
118 | if ((p = bozo_escape_html(httpd, printname)) != NULL) { | | 118 | if ((p = bozo_escape_html(httpd, printname)) != NULL) { |
119 | free(printname); | | 119 | free(printname); |
120 | printname = p; | | 120 | printname = p; |
121 | } | | 121 | } |
122 | | | 122 | |
123 | bozo_printf(httpd, | | 123 | bozo_printf(httpd, |
124 | "<!DOCTYPE html>\r\n" | | 124 | "<!DOCTYPE html>\r\n" |
125 | "<html><head><meta charset=\"utf-8\"/>\r\n" | | 125 | "<html><head><meta charset=\"utf-8\"/>\r\n" |
| | | 126 | "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n" |
126 | "<style type=\"text/css\">\r\n" | | 127 | "<style type=\"text/css\">\r\n" |
127 | "table {\r\n" | | 128 | "table {\r\n" |
128 | "\tborder-top: 1px solid black;\r\n" | | 129 | "\tborder-top: 1px solid black;\r\n" |
129 | "\tborder-bottom: 1px solid black;\r\n" | | 130 | "\tborder-bottom: 1px solid black;\r\n" |
130 | "}\r\n" | | 131 | "}\r\n" |
131 | "th { background: aquamarine; }\r\n" | | 132 | "th { background: aquamarine; }\r\n" |
132 | "tr:nth-child(even) { background: lavender; }\r\n" | | 133 | "tr:nth-child(even) { background: lavender; }\r\n" |
133 | "</style>\r\n"); | | 134 | "</style>\r\n"); |
134 | bozo_printf(httpd, "<title>Index of %s</title></head>\r\n", | | 135 | bozo_printf(httpd, "<title>Index of %s</title></head>\r\n", |
135 | printname); | | 136 | printname); |
136 | bozo_printf(httpd, "<body><h1>Index of %s</h1>\r\n", | | 137 | bozo_printf(httpd, "<body><h1>Index of %s</h1>\r\n", |
137 | printname); | | 138 | printname); |
138 | bozo_printf(httpd, | | 139 | bozo_printf(httpd, |