mirror of https://github.com/omar-polo/gmid.git
add a trailing / for dirs in the directory index.
This commit is contained in:
parent
5734723f92
commit
543f4a66fe
6
server.c
6
server.c
|
@ -1098,9 +1098,13 @@ client_write(struct bufferevent *bev, void *d)
|
||||||
case REQUEST_DIR:
|
case REQUEST_DIR:
|
||||||
/* TODO: handle big big directories better */
|
/* TODO: handle big big directories better */
|
||||||
for (c->diroff = 0; c->diroff < c->dirlen; ++c->diroff) {
|
for (c->diroff = 0; c->diroff < c->dirlen; ++c->diroff) {
|
||||||
|
const char *sufx = "";
|
||||||
|
|
||||||
encode_path(nam, sizeof(nam),
|
encode_path(nam, sizeof(nam),
|
||||||
c->dir[c->diroff]->d_name);
|
c->dir[c->diroff]->d_name);
|
||||||
evbuffer_add_printf(out, "=> ./%s\n", nam);
|
if (c->dir[c->diroff]->d_type == DT_DIR)
|
||||||
|
sufx = "/";
|
||||||
|
evbuffer_add_printf(out, "=> ./%s%s\n", nam, sufx);
|
||||||
free(c->dir[c->diroff]);
|
free(c->dir[c->diroff]);
|
||||||
}
|
}
|
||||||
free(c->dir);
|
free(c->dir);
|
||||||
|
|
Loading…
Reference in New Issue