mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
DIRLIST: Use directory listing initializer in the FSP protocol module
This commit is contained in:
parent
b567f6a5db
commit
d8ef7e1b68
@ -131,21 +131,16 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri)
|
|||||||
{
|
{
|
||||||
struct string buf;
|
struct string buf;
|
||||||
FSP_DIR *dir;
|
FSP_DIR *dir;
|
||||||
unsigned char *uristring = get_uri_string(uri, URI_PUBLIC);
|
|
||||||
unsigned char *data = get_uri_string(uri, URI_DATA);
|
unsigned char *data = get_uri_string(uri, URI_DATA);
|
||||||
unsigned char dircolor[8] = "";
|
unsigned char dircolor[8] = "";
|
||||||
|
|
||||||
if (!uristring || !data || !init_string(&buf))
|
if (!data || init_directory_listing(&buf, uri) != S_OK)
|
||||||
fsp_error("Out of memory");
|
fsp_error("Out of memory");
|
||||||
|
|
||||||
fprintf(stderr, "text/html");
|
fprintf(stderr, "text/html");
|
||||||
fclose(stderr);
|
fclose(stderr);
|
||||||
add_html_to_string(&buf, uristring, strlen(uristring));
|
|
||||||
|
|
||||||
printf("<html><head><title>%s</title><base href=\"%s", buf.source,
|
puts(buf.source);
|
||||||
uristring);
|
|
||||||
if (buf.source[buf.length - 1] != '/') printf("/");
|
|
||||||
printf("\"></head><body><h2>FSP directory %s</h2><pre>", buf.source);
|
|
||||||
|
|
||||||
dir = fsp_opendir(ses, data);
|
dir = fsp_opendir(ses, data);
|
||||||
if (!dir) goto end;
|
if (!dir) goto end;
|
||||||
|
Loading…
Reference in New Issue
Block a user