Project

General

Profile

Bug #2823 » patch3-src_mod_dirlisting.c.patch

fjo, 2017-10-02 12:18

View differences:

src/mod_dirlisting.c
" if (a.cells[sort_column].className == 'int') {\n" \
" cmp = parseInt(at)-parseInt(bt);\n" \
" } else if (sort_column == date_column) {\n" \
" cmp = Date.parse(at.replace(/-/g, '/'))\n" \
" - Date.parse(bt.replace(/-/g, '/'));\n" \
" var ad = isdigit(at.substr(0,1));\n" \
" var bd = isdigit(bt.substr(0,1));\n" \
" if (ad != bd) return (!ad ? -1 : 1);\n" \
" var as = a.cells[sort_column].getAttribute(\"data-time\");\n" \
" var bs = b.cells[sort_column].getAttribute(\"data-time\");\n" \
" if (as && bs) {\n" \
" cmp = parseInt(as) - parseInt(bs);\n" \
" } else {\n" \
" cmp = Date.parse(at.replace(/-/g, '/'))\n" \
" - Date.parse(bt.replace(/-/g, '/'));\n" \
" var ad = isdigit(at.substr(0,1));\n" \
" var bd = isdigit(bt.substr(0,1));\n" \
" if (ad != bd) return (!ad ? -1 : 1);\n" \
" }\n" \
" } else if (sort_column == size_column) {\n" \
" var ai = parseInt(at, 10) * unit_multiplier(at.substr(-1,1));\n" \
" var bi = parseInt(bt, 10) * unit_multiplier(bt.substr(-1,1));\n" \
......
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_REL_URI_PART);
buffer_append_string_len(out, CONST_STR_LEN("/\">"));
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML);
buffer_append_string_len(out, CONST_STR_LEN("</a>/</td><td class=\"m\">"));
buffer_append_string_len(out, CONST_STR_LEN("</a>/</td><td class=\"m\" data-time=\""));
buffer_append_int(out, tmp->mtime);
buffer_append_string_len(out, CONST_STR_LEN("\">"));
buffer_append_string_len(out, datebuf, sizeof(datebuf) - 1);
buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"s\">- &nbsp;</td><td class=\"t\">Directory</td></tr>\n"));
......
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_REL_URI_PART);
buffer_append_string_len(out, CONST_STR_LEN("\">"));
buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML);
buffer_append_string_len(out, CONST_STR_LEN("</a></td><td class=\"m\">"));
buffer_append_string_len(out, CONST_STR_LEN("</a></td><td class=\"m\" data-time=\""));
buffer_append_int(out, tmp->mtime);
buffer_append_string_len(out, CONST_STR_LEN("\">"));
buffer_append_string_len(out, datebuf, sizeof(datebuf) - 1);
buffer_append_string_len(out, CONST_STR_LEN("</td><td class=\"s\">"));
buffer_append_string(out, sizebuf);
(3-3/3)