]> granicus.if.org Git - apache/commitdiff
Thanks Ryan for cleaning up after my laziness. :) Here are just a few
authorCliff Woolley <jwoolley@apache.org>
Thu, 30 May 2002 00:35:25 +0000 (00:35 +0000)
committerCliff Woolley <jwoolley@apache.org>
Thu, 30 May 2002 00:35:25 +0000 (00:35 +0000)
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

modules/mappers/mod_rewrite.c

index e394da9a366373cb18110d3af2062e25f58f1af8..ee628626cf88a7df3c3ecfd770c132c4ec11b5ab 100644 (file)
@@ -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) ||