mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
fsp: Drop the protocol.fsp.sort, always sort entries.
The fsp_opendir always read the whole directory. Sorting entries do not slow down noticeably.
This commit is contained in:
parent
4c390589ea
commit
213b1933b3
@ -40,22 +40,9 @@
|
|||||||
#include "util/snprintf.h"
|
#include "util/snprintf.h"
|
||||||
#include "util/string.h"
|
#include "util/string.h"
|
||||||
|
|
||||||
|
|
||||||
struct option_info fsp_options[] = {
|
|
||||||
INIT_OPT_TREE("protocol", N_("FSP"),
|
|
||||||
"fsp", 0,
|
|
||||||
N_("FSP specific options.")),
|
|
||||||
|
|
||||||
INIT_OPT_BOOL("protocol.fsp", N_("Sort entries"),
|
|
||||||
"sort", 0, 1,
|
|
||||||
N_("Whether to sort entries in directory listings.")),
|
|
||||||
|
|
||||||
NULL_OPTION_INFO,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct module fsp_protocol_module = struct_module(
|
struct module fsp_protocol_module = struct_module(
|
||||||
/* name: */ N_("FSP"),
|
/* name: */ N_("FSP"),
|
||||||
/* options: */ fsp_options,
|
/* options: */ NULL,
|
||||||
/* hooks: */ NULL,
|
/* hooks: */ NULL,
|
||||||
/* submodules: */ NULL,
|
/* submodules: */ NULL,
|
||||||
/* data: */ NULL,
|
/* data: */ NULL,
|
||||||
@ -233,19 +220,7 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri)
|
|||||||
dircolor);
|
dircolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_opt_bool("protocol.fsp.sort", NULL)) {
|
sort_and_display_entries(dir, dircolor);
|
||||||
sort_and_display_entries(dir, dircolor);
|
|
||||||
} else {
|
|
||||||
/* &tmp works around a bug in fsplib 0.9 or earlier.
|
|
||||||
* See sort_and_display_entries for details. */
|
|
||||||
FSP_RDENTRY fentry, tmp;
|
|
||||||
FSP_RDENTRY *fresult = &tmp;
|
|
||||||
|
|
||||||
while (!fsp_readdir_native(dir, &fentry, &fresult)) {
|
|
||||||
if (!fresult) break;
|
|
||||||
display_entry(&fentry, dircolor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fsp_closedir(dir);
|
fsp_closedir(dir);
|
||||||
puts("</pre><hr/></body></html>");
|
puts("</pre><hr/></body></html>");
|
||||||
fsp_close_session(ses);
|
fsp_close_session(ses);
|
||||||
|
Loading…
Reference in New Issue
Block a user