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=ce7330d2237bd4170843691daaba961082860ae8;p=rrdtool.git added patch for apache 2 compatibility git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@165 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 9c81c15..83a481f 100644 --- a/src/rrd_cgi.c +++ b/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); }