coar98/10/17 07:17:11
Modified:src CHANGES
src/modules/standard mod_autoindex.c
Log:
IndexOptions NameWidth was not getting inherited properly
by directories that had mod_autoindex directives in the .htaccess
but no actual IndexOptions line. Also, NameWidth, IconHeight,
and IconWidth couldn't be incrementally enabled with '+'.
Revision ChangesPath
1.1110+3 -0 apache-1.3/src/CHANGES
Index: CHANGES
===
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1109
retrieving revision 1.1110
diff -u -r1.1109 -r1.1110
--- CHANGES 1998/10/16 07:04:41 1.1109
+++ CHANGES 1998/10/17 14:17:08 1.1110
@@ -1,5 +1,8 @@
Changes with Apache 1.3.4
+ *) Fix inheritance of IndexOptions NameWidth and remove unintended
+ restriction on +NameWidth, +IconHeight, and +IconWidth. [Ken Coar]
+
*) Fix per-directory config merging for cases in which a 500 error
is encountered in an .htaccess file somewhere down the tree.
[Ken Coar] PR#2409
1.97 +28 -12apache-1.3/src/modules/standard/mod_autoindex.c
Index: mod_autoindex.c
===
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- mod_autoindex.c 1998/10/04 06:13:18 1.96
+++ mod_autoindex.c 1998/10/17 14:17:10 1.97
@@ -98,6 +98,10 @@
#define K_PAD 1
#define K_NOPAD 0
+#define K_NOADJUST 0
+#define K_ADJUST 1
+#define K_UNSET 2
+
/*
* Define keys for sorting.
*/
@@ -368,8 +372,8 @@
}
}
else if (!strncasecmp(w, IconWidth=, 10)) {
- if (action != '\0') {
- return Cannot combine '+' or '-' with IconWidth=n;
+ if (action == '-') {
+ return Cannot combine '-' with IconWidth=n;
}
d_cfg-icon_width = atoi(w[10]);
}
@@ -382,8 +386,8 @@
}
}
else if (!strncasecmp(w, IconHeight=, 11)) {
- if (action != '\0') {
- return Cannot combine '+' or '-' with IconHeight=n;
+ if (action == '-') {
+ return Cannot combine '-' with IconHeight=n;
}
d_cfg-icon_height = atoi(w[11]);
}
@@ -393,14 +397,14 @@
'-NameWidth';
}
d_cfg-name_width = DEFAULT_NAME_WIDTH;
- d_cfg-name_adjust = 0;
+ d_cfg-name_adjust = K_NOADJUST;
}
else if (!strncasecmp(w, NameWidth=, 10)) {
- if (action != '\0') {
- return Cannot combine '+' or '-' with NameWidth=n;
+ if (action == '-') {
+ return Cannot combine '-' with NameWidth=n;
}
if (w[10] == '*') {
- d_cfg-name_adjust = 1;
+ d_cfg-name_adjust = K_ADJUST;
}
else {
int width = atoi(w[10]);
@@ -409,6 +413,7 @@
return NameWidth value must be greater than 1;
}
d_cfg-name_width = width;
+ d_cfg-name_adjust = K_NOADJUST;
}
}
else {
@@ -477,7 +482,7 @@
new-icon_width = 0;
new-icon_height = 0;
new-name_width = DEFAULT_NAME_WIDTH;
-new-name_adjust = 0;
+new-name_adjust = K_UNSET;
new-icon_list = ap_make_array(p, 4, sizeof(struct item));
new-alt_list = ap_make_array(p, 4, sizeof(struct item));
new-desc_list = ap_make_array(p, 4, sizeof(struct item));
@@ -550,9 +555,20 @@
*/
new-opts |= new-incremented_opts;
new-opts = ~new-decremented_opts;
+}
+/*
+ * Inherit the NameWidth settings if there aren't any specific to
+ * the new location; otherwise we'll end up using the defaults set in the
+ * config-rec creation routine.
+ */
+if (add-name_adjust == K_UNSET) {
+ new-name_width = base-name_width;
+ new-name_adjust = base-name_adjust;
+}
+else {
+ new-name_width = add-name_width;
+ new-name_adjust = add-name_adjust;
}
-new-name_width = add-name_width;
-new-name_adjust = add-name_adjust;
return new;
}
@@ -1030,7 +1046,7 @@
}
name_width = d-name_width;
-if (d-name_adjust) {
+if (d-name_adjust == K_ADJUST) {
for (x = 0; x n; x++) {
int t = strlen(ar[x]-name);
if (t name_width) {