Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/networking/httpd_indexcgi.c

    r1765 r2725  
    22 * Copyright (c) 2007 Denys Vlasenko <vda.linux@googlemail.com>
    33 *
    4  * Licensed under GPLv2, see file LICENSE in this tarball for details.
     4 * Licensed under GPLv2, see file LICENSE in this source tree.
    55 */
    66
     
    2929/* Currently malloc machinery is the biggest part of libc we pull in. */
    3030/* We have only one realloc and one strdup, any idea how to do without? */
    31 /* Size (i386, approximate):
     31
     32/* Size (i386, static uclibc, approximate):
    3233 *   text    data     bss     dec     hex filename
    3334 *  13036      44    3052   16132    3f04 index.cgi
     
    126127    if (buffer + (BUFFER_SIZE-HEADROOM) - dst >= size)
    127128        return;
    128     write(1, buffer, dst - buffer);
     129    write(STDOUT_FILENO, buffer, dst - buffer);
    129130    dst = buffer;
    130131}
     
    149150        *dst = c;
    150151        if ((c - '0') > 9 /* not a digit */
    151          && ((c|0x20) - 'a') > 26 /* not A-Z or a-z */
     152         && ((c|0x20) - 'a') > ('z' - 'a') /* not A-Z or a-z */
    152153         && !strchr("._-+@", c)
    153154        ) {
     
    211212}
    212213
    213 int main(void)
     214int main(int argc, char *argv[])
    214215{
    215216    dir_list_t *dir_list;
     
    226227    if (!QUERY_STRING
    227228     || QUERY_STRING[0] != '/'
     229     || strstr(QUERY_STRING, "//")
    228230     || strstr(QUERY_STRING, "/../")
    229231     || strcmp(strrchr(QUERY_STRING, '/'), "/..") == 0
     
    290292    cdir = dir_list;
    291293    while (dir_list_count--) {
    292         struct tm *tm;
     294        struct tm *ptm;
    293295
    294296        if (S_ISDIR(cdir->dl_mode)) {
     
    314316            fmt_ull(cdir->dl_size);
    315317        fmt_str("<td class=dt>");
    316         tm = gmtime(&cdir->dl_mtime);
    317         fmt_04u(1900 + tm->tm_year); *dst++ = '-';
    318         fmt_02u(tm->tm_mon + 1); *dst++ = '-';
    319         fmt_02u(tm->tm_mday); *dst++ = ' ';
    320         fmt_02u(tm->tm_hour); *dst++ = ':';
    321         fmt_02u(tm->tm_min); *dst++ = ':';
    322         fmt_02u(tm->tm_sec);
     318        ptm = gmtime(&cdir->dl_mtime);
     319        fmt_04u(1900 + ptm->tm_year); *dst++ = '-';
     320        fmt_02u(ptm->tm_mon + 1); *dst++ = '-';
     321        fmt_02u(ptm->tm_mday); *dst++ = ' ';
     322        fmt_02u(ptm->tm_hour); *dst++ = ':';
     323        fmt_02u(ptm->tm_min); *dst++ = ':';
     324        fmt_02u(ptm->tm_sec);
    323325        *dst++ = '\n';
    324326
Note: See TracChangeset for help on using the changeset viewer.