From: Cliff Woolley Date: Thu, 30 May 2002 00:35:25 +0000 (+0000) Subject: Thanks Ryan for cleaning up after my laziness. :) Here are just a few X-Git-Tag: 2.0.37~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ad4ce4d76b033f7b58cf8d82207b3b6d1edb1e3;p=apache Thanks Ryan for cleaning up after my laziness. :) Here are just a few last little changes. ->datafile should be initialized... but doing so brings up the fact that the check in run_rewritemap_programs() was expecting ->datafile to have a string attached to it. For clarity, let's just use argv[0] there. And since we've reinstated the use of ->checkfile, we no longer need that extra apr_stat() I hacked in, so let's get rid of it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95375 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index e394da9a36..ee628626cf 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -454,8 +454,9 @@ static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, const char *a1, #endif } else if (strncmp(a2, "prg:", 4) == 0) { - newmap->type = MAPTYPE_PRG; + newmap->type = MAPTYPE_PRG; apr_tokenize_to_argv(a2 + 4, &newmap->argv, cmd->pool); + newmap->datafile = NULL; newmap->checkfile = newmap->argv[0]; } @@ -3397,8 +3398,8 @@ static apr_status_t run_rewritemap_programs(server_rec *s, apr_pool_t *p) if (map->type != MAPTYPE_PRG) { continue; } - if (map->datafile == NULL - || *(map->datafile) == '\0' + if (map->argv[0] == NULL + || *(map->argv[0]) == '\0' || map->fpin != NULL || map->fpout != NULL ) { continue; @@ -3429,10 +3430,8 @@ static apr_status_t rewritemap_program_child(apr_pool_t *p, apr_status_t rc; apr_procattr_t *procattr; apr_proc_t *procnew; - apr_finfo_t st; - if (((rc = apr_stat(&st, argv[0], APR_FINFO_MIN, p)) != APR_SUCCESS) || - ((rc = apr_procattr_create(&procattr, p)) != APR_SUCCESS) || + if (((rc = apr_procattr_create(&procattr, p)) != APR_SUCCESS) || ((rc = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_FULL_NONBLOCK, APR_FULL_NONBLOCK)) != APR_SUCCESS) ||