bluesky_root> diff -u httpd.c http-statfirst.c diff -u httpd.c http-statfirst.c --- httpd.c Mon Jan 6 16:44:01 2003 +++ http-statfirst.c Tue Jan 7 10:50:35 2003 @@ -1,3 +1,4 @@ +#include #include "pathdecode.h" #include "file.h" #include "filetype.h" @@ -111,8 +112,10 @@ unsigned long length; unsigned long lengthgz; int fd; - int fdgz; + int fdgz = -1; int r; + struct stat st; + host.len = byte_chr(host.s,host.len,':'); if (!host.len) { @@ -133,7 +136,9 @@ if (!stralloc_copy(&fngz,&fn)) _exit(21); if (!stralloc_cats(&fngz,".gz")) _exit(21); if (!stralloc_0(&fngz)) _exit(21); - fdgz = file_open(fngz.s,&mtimegz,&lengthgz,1); + /* Only call file_open if we can stat the .gz file */ + if (!stat(fngz.s,&st)) + fdgz = file_open(fngz.s,&mtimegz,&lengthgz,1); if (fdgz < 0) flaggzip = 0; } bluesky_root>