mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed bug with '\' in front of resource directory
SVN revision: 377
This commit is contained in:
parent
4669414a4c
commit
57a5fe0471
12
src/elogd.c
12
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.5 2003/02/07 12:25:27 midas
|
||||||
|
Fixed bug with '\' in front of resource directory
|
||||||
|
|
||||||
Revision 1.4 2003/01/31 20:29:27 midas
|
Revision 1.4 2003/01/31 20:29:27 midas
|
||||||
Fixed typo
|
Fixed typo
|
||||||
|
|
||||||
@ -4097,10 +4100,8 @@ void send_file_direct(char *file_name)
|
|||||||
{
|
{
|
||||||
int fh, i, length;
|
int fh, i, length;
|
||||||
char str[256];
|
char str[256];
|
||||||
/*
|
|
||||||
time_t now;
|
time_t now;
|
||||||
struct tm *gmt;
|
struct tm *gmt;
|
||||||
*/
|
|
||||||
|
|
||||||
fh = open(file_name, O_RDONLY | O_BINARY);
|
fh = open(file_name, O_RDONLY | O_BINARY);
|
||||||
if (fh > 0)
|
if (fh > 0)
|
||||||
@ -4113,13 +4114,12 @@ struct tm *gmt;
|
|||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
||||||
rsprintf("Accept-Ranges: bytes\r\n");
|
rsprintf("Accept-Ranges: bytes\r\n");
|
||||||
|
|
||||||
/*
|
/* set expiration time to one day */
|
||||||
time(&now);
|
time(&now);
|
||||||
now += (int) (3600*3);
|
now += (int) (3600*24);
|
||||||
gmt = gmtime(&now);
|
gmt = gmtime(&now);
|
||||||
strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);
|
strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);
|
||||||
rsprintf("Expires: %s\r\n", str);
|
rsprintf("Expires: %s\r\n", str);
|
||||||
*/
|
|
||||||
|
|
||||||
if (use_keepalive)
|
if (use_keepalive)
|
||||||
{
|
{
|
||||||
@ -10411,7 +10411,7 @@ FILE *f;
|
|||||||
{
|
{
|
||||||
/* file from theme directory requested */
|
/* file from theme directory requested */
|
||||||
strlcpy(file_name, resource_dir, sizeof(file_name));
|
strlcpy(file_name, resource_dir, sizeof(file_name));
|
||||||
if (file_name[strlen(file_name)-1] != DIR_SEPARATOR)
|
if (file_name[0] && file_name[strlen(file_name)-1] != DIR_SEPARATOR)
|
||||||
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
|
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
|
||||||
strlcat(file_name, "themes", sizeof(file_name));
|
strlcat(file_name, "themes", sizeof(file_name));
|
||||||
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
|
strlcat(file_name, DIR_SEPARATOR_STR, sizeof(file_name));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user