]> granicus.if.org Git - apache/commitdiff
change short-lived behavior of "DirectoryIndex None" based on feedback from wrowe:
authorEric Covener <covener@apache.org>
Wed, 12 Nov 2008 19:25:03 +0000 (19:25 +0000)
committerEric Covener <covener@apache.org>
Wed, 12 Nov 2008 19:25:03 +0000 (19:25 +0000)
Doesn't search for anything:
  DirectoryIndex disabled

Does search for literal "disabled":
  DirectoryIndex disabled foo.
  DirectoryIndex foo disabled
  DirectoryIndex disabled disabled

Does search:
  DirectoryIndex disabled.html

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@713462 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_dir.html.en
docs/manual/mod/mod_dir.xml
docs/manual/mod/mod_dir.xml.meta
modules/mappers/mod_dir.c

index 848c7af0ee5efa2794e00df5167a223921b59567..2ce73e0990a5e913ecc075f912fb1b8018a7d9e2 100644 (file)
@@ -68,7 +68,7 @@
 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>List of resources to look for when the client requests
 a directory</td></tr>
 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DirectoryIndex
-    None | <var>local-url</var> [<var>local-url</var>] ...</code></td></tr>
+    disabled | <var>local-url</var> [<var>local-url</var>] ...</code></td></tr>
 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DirectoryIndex index.html</code></td></tr>
 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
@@ -105,8 +105,10 @@ a directory</td></tr>
     executed if neither <code>index.html</code> or <code>index.txt</code>
     existed in a directory.</p>
 
-    <p>A value of "None" prevents <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> from 
-    searching for an index.</p>
+    <p>A single argument of "disabled" prevents <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> from 
+    searching for an index.  An argument of "disabled" will be interpeted
+    literally if it has any arguments before or after it, even if they are "disabled"
+    as well.</p>
 
 
 </div>
index fd500dc83447a6cdab4bec62eb66fd6556d3c07a..3e43020bd0f63e106bf2ec730fdc3b10ced33190 100644 (file)
@@ -58,7 +58,7 @@
 <description>List of resources to look for when the client requests
 a directory</description>
 <syntax>DirectoryIndex
-    None | <var>local-url</var> [<var>local-url</var>] ...</syntax>
+    disabled | <var>local-url</var> [<var>local-url</var>] ...</syntax>
 <default>DirectoryIndex index.html</default>
 <contextlist><context>server config</context><context>virtual host</context>
 <context>directory</context><context>.htaccess</context></contextlist>
@@ -95,8 +95,10 @@ a directory</description>
     executed if neither <code>index.html</code> or <code>index.txt</code>
     existed in a directory.</p>
 
-    <p>A value of "None" prevents <module>mod_dir</module> from 
-    searching for an index.</p>
+    <p>A single argument of "disabled" prevents <module>mod_dir</module> from 
+    searching for an index.  An argument of "disabled" will be interpeted
+    literally if it has any arguments before or after it, even if they are "disabled"
+    as well.</p>
 
 </usage>
 </directivesynopsis>
index 773d360b7d60281add06e6360df3c1c56cb81fb7..ff71f9e18d469dc20dcfa3543ad9877360805bf0 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!-- GENERATED FROM XML: DO NOT EDIT -->
 
 <metafile>
   <basename>mod_dir</basename>
index d61c2892edda85a53ac6c9709027bfcaeb65a288..8dcb0194d72bcd7dca3fc4c808fa12b6307b9dab 100644 (file)
@@ -47,13 +47,30 @@ typedef struct dir_config_struct {
 static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg)
 {
     dir_config_rec *d = dummy;
-
+    const char *t, *w;
+    int count = 0;
+   
     if (!d->index_names) {
         d->index_names = apr_array_make(cmd->pool, 2, sizeof(char *));
     }
-    if (strcasecmp(arg, "none")) { 
-        *(const char **)apr_array_push(d->index_names) = arg;
+
+    t = arg;
+    while ((w = ap_getword_conf(cmd->pool, &t)) && w[0]) { 
+        if (count == 0 && !strcasecmp(w, "disabled")) { 
+            /* peek to see if "disabled" is first in a series of arguments */
+            const char *tt = t;
+            fprintf(stderr, "t:'%s'\n", t);
+            const char *ww = ap_getword_conf(cmd->pool, &tt);
+            if (ww == NULL || !ww[0]) { 
+               /* "disabled" is first, and alone */
+                
+               continue;
+            }
+        }
+        *(const char **)apr_array_push(d->index_names) = w;
+        count++;
     }
+
     return NULL;
 }
 
@@ -67,7 +84,7 @@ static const char *configure_slash(cmd_parms *cmd, void *d_, int arg)
 
 static const command_rec dir_cmds[] =
 {
-    AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
+    AP_INIT_RAW_ARGS("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
                     "a list of file names"),
     AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS,
                  "On or Off"),