1
0
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:
Jonas Fonseca 2006-01-30 01:25:39 +01:00 committed by Jonas Fonseca
parent b567f6a5db
commit d8ef7e1b68

View File

@ -131,21 +131,16 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri)
{
struct string buf;
FSP_DIR *dir;
unsigned char *uristring = get_uri_string(uri, URI_PUBLIC);
unsigned char *data = get_uri_string(uri, URI_DATA);
unsigned char dircolor[8] = "";
if (!uristring || !data || !init_string(&buf))
if (!data || init_directory_listing(&buf, uri) != S_OK)
fsp_error("Out of memory");
fprintf(stderr, "text/html");
fclose(stderr);
add_html_to_string(&buf, uristring, strlen(uristring));
printf("<html><head><title>%s</title><base href=\"%s", buf.source,
uristring);
if (buf.source[buf.length - 1] != '/') printf("/");
printf("\"></head><body><h2>FSP directory %s</h2><pre>", buf.source);
puts(buf.source);
dir = fsp_opendir(ses, data);
if (!dir) goto end;