791 |
addstring(&str, " <tr>\n"); |
addstring(&str, " <tr>\n"); |
792 |
addstring(&str, " <th></th>\n"); |
addstring(&str, " <th></th>\n"); |
793 |
addstring(&str, " <th>Filename</th>\n"); |
addstring(&str, " <th>Filename</th>\n"); |
794 |
|
addstring(&str, " <th>Last-modified</th>\n"); |
795 |
addstring(&str, " <th>MIME</th>\n"); |
addstring(&str, " <th>MIME</th>\n"); |
796 |
addstring(&str, " <th>Size</th>\n"); |
addstring(&str, " <th>Size</th>\n"); |
797 |
addstring(&str, " </tr>\n"); |
addstring(&str, " </tr>\n"); |
809 |
char* fpth = cm_strcat3(path, "/", items[i]); |
char* fpth = cm_strcat3(path, "/", items[i]); |
810 |
struct stat s; |
struct stat s; |
811 |
char size[512]; |
char size[512]; |
812 |
|
char date[512]; |
813 |
char* showmime; |
char* showmime; |
814 |
char* mime; |
char* mime; |
815 |
|
struct tm* tm; |
816 |
size[0] = 0; |
size[0] = 0; |
817 |
stat(fpth, &s); |
stat(fpth, &s); |
818 |
|
tm = localtime(&s.st_mtime); |
819 |
|
strftime(date, 512, "%a, %d %b %Y %H:%M:%S %Z", tm); |
820 |
if(phase == 0 && !S_ISDIR(s.st_mode)) { |
if(phase == 0 && !S_ISDIR(s.st_mode)) { |
821 |
free(fpth); |
free(fpth); |
822 |
continue; |
continue; |
890 |
addstring(&str, "<tr>\n"); |
addstring(&str, "<tr>\n"); |
891 |
addstring(&str, " <td><img src=\"%s\" alt=\"icon\"></td>\n", icon); |
addstring(&str, " <td><img src=\"%s\" alt=\"icon\"></td>\n", icon); |
892 |
addstring(&str, " <td><a href=\"%l\"><code>%h</code></a></td>\n", items[i], itm); |
addstring(&str, " <td><a href=\"%l\"><code>%h</code></a></td>\n", items[i], itm); |
893 |
|
addstring(&str, " <td><code> %h </code></td>\n", date); |
894 |
addstring(&str, " <td><code> %h </code></td>\n", showmime); |
addstring(&str, " <td><code> %h </code></td>\n", showmime); |
895 |
addstring(&str, " <td><code> %s </code></td>\n", size); |
addstring(&str, " <td><code> %s </code></td>\n", size); |
896 |
addstring(&str, "</tr>\n"); |
addstring(&str, "</tr>\n"); |