From: William A. Rowe Jr Date: Sat, 13 Apr 2002 19:52:59 +0000 (+0000) Subject: Wasted at least 20 minutes reparsing this code till I determined it's X-Git-Tag: 2.0.36~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe28459eb0891176d2d3071dd6cb594681f33fd3;p=thirdparty%2Fapache%2Fhttpd.git Wasted at least 20 minutes reparsing this code till I determined it's correct. But make the sucker legible so noone else repeats the experience. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94635 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 0dcf7f3ff69..b0fd03600f9 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -515,11 +515,11 @@ static apr_status_t default_build_command(const char **cmd, const char ***argv, int numwords, x, idx; char *w; const char *args = r->args; - const char *argv0; if (replace_cmd) { /* Allow suexec's "/" check to succeed */ - if ((argv0 = strrchr(r->filename, '/')) != NULL) + const char *argv0 = strrchr(r->filename, '/'); + if (argv0 != NULL) argv0++; else argv0 = r->filename;