From: oetiker Date: Thu, 24 Oct 2002 21:17:51 +0000 (+0000) Subject: added patch for apache 2 compatibility X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e7aecbac8c7e4c57f1f74495312a9d12f2be04a;p=rrdtool-all.git added patch for apache 2 compatibility git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@165 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index 9c81c154..83a481f8 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -128,9 +128,9 @@ int main(int argc, char *argv[]) { server_url = getenv("SERVER_URL"); } - if (optind != argc-1) { - fprintf(stderr, "ERROR: expected a filename\n"); - exit(1); + if ( (optind != argc-2 && strstr(getenv("SERVER_SOFTWARE"),"Apache/2") != NULL) && optind != argc-1) { + fprintf(stderr, "ERROR: expected a filename\n"); + exit(1); } else { length = readfile(argv[optind], &buffer, 1); }