aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Ponomarev <stokito@gmail.com>2020-07-10 22:48:13 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2020-07-31 18:14:54 +0200
commita088da4476012e067a9a49de997031ea64ac401e (patch)
tree8197d8fea915c4f98db5c6b9b422c633f149315a
parent197ae0f9ae71c2c313a56f7ce8807411f8a2562a (diff)
downloadbusybox-w32-a088da4476012e067a9a49de997031ea64ac401e.tar.gz
busybox-w32-a088da4476012e067a9a49de997031ea64ac401e.tar.bz2
busybox-w32-a088da4476012e067a9a49de997031ea64ac401e.zip
httpd_indexcgi.c: use CSS for odd/even rows
Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/httpd_indexcgi.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c
index f5f18959d..47b1159f4 100644
--- a/networking/httpd_indexcgi.c
+++ b/networking/httpd_indexcgi.c
@@ -76,9 +76,8 @@ httpd_indexcgi.c -o index.cgi
76 "border-color:black;" /* black black black black; */ \ 76 "border-color:black;" /* black black black black; */ \
77 "white-space:nowrap" \ 77 "white-space:nowrap" \
78"}" \ 78"}" \
79"tr:nth-child(odd) { background-color:#ffffff }" \
79"tr.hdr { background-color:#eee5de }" \ 80"tr.hdr { background-color:#eee5de }" \
80"tr.o { background-color:#ffffff }" \
81/* tr.e { ... } - for even rows (currently none) */ \
82"tr.foot { background-color:#eee5de }" \ 81"tr.foot { background-color:#eee5de }" \
83"th.cnt { text-align:left }" \ 82"th.cnt { text-align:left }" \
84"th.sz { text-align:right }" \ 83"th.sz { text-align:right }" \
@@ -220,7 +219,6 @@ int main(int argc, char *argv[])
220 unsigned count_dirs; 219 unsigned count_dirs;
221 unsigned count_files; 220 unsigned count_files;
222 unsigned long long size_total; 221 unsigned long long size_total;
223 int odd;
224 DIR *dirp; 222 DIR *dirp;
225 char *location; 223 char *location;
226 224
@@ -291,7 +289,6 @@ int main(int argc, char *argv[])
291 "<col class=nm><col class=sz><col class=dt>" "\n" 289 "<col class=nm><col class=sz><col class=dt>" "\n"
292 "<tr class=hdr><th class=cnt>Name<th class=sz>Size<th class=dt>Last modified" "\n"); 290 "<tr class=hdr><th class=cnt>Name<th class=sz>Size<th class=dt>Last modified" "\n");
293 291
294 odd = 0;
295 count_dirs = 0; 292 count_dirs = 0;
296 count_files = 0; 293 count_files = 0;
297 size_total = 0; 294 size_total = 0;
@@ -307,9 +304,7 @@ int main(int argc, char *argv[])
307 } else 304 } else
308 goto next; 305 goto next;
309 306
310 fmt_str("<tr class="); 307 fmt_str("<tr><td class=nm><a href='");
311 *dst++ = (odd ? 'o' : 'e');
312 fmt_str("><td class=nm><a href='");
313 fmt_url(cdir->dl_name); /* %20 etc */ 308 fmt_url(cdir->dl_name); /* %20 etc */
314 if (S_ISDIR(cdir->dl_mode)) 309 if (S_ISDIR(cdir->dl_mode))
315 *dst++ = '/'; 310 *dst++ = '/';
@@ -330,7 +325,6 @@ int main(int argc, char *argv[])
330 fmt_02u(ptm->tm_sec); 325 fmt_02u(ptm->tm_sec);
331 *dst++ = '\n'; 326 *dst++ = '\n';
332 327
333 odd = 1 - odd;
334 next: 328 next:
335 cdir++; 329 cdir++;
336 } 330 }