Project

General

Profile

Bug #943 » lighttpd-mod_expire-weeks.patch

for 1.4.13 -- Elan Ruusamäe <glen - Anonymous, 2006-12-19 13:07

View differences:

lighttpd-1.4.13/src/mod_expire.c 2006-12-19 14:56:31.510009332 +0200
85 85
	/*
86 86
	 * parse
87 87
	 *
88
	 * '(access|modification) [plus] {<num> <type>}*'
88
	 * '(access|now|modification) [plus] {<num> <type>}*'
89 89
	 *
90 90
	 * e.g. 'access 1 years'
91 91
	 */
......
101 101
	if (0 == strncmp(ts, "access ", 7)) {
102 102
		type  = 0;
103 103
		ts   += 7;
104
	} else if (0 == strncmp(ts, "now ", 4)) {
105
		type  = 0;
106
		ts   += 4;
104 107
	} else if (0 == strncmp(ts, "modification ", 13)) {
105 108
		type  = 1;
106 109
		ts   += 13;
......
119 122
		ts   += 5;
120 123
	}
121 124

  
122
	/* the rest is just <number> (years|months|days|hours|minutes|seconds) */
125
	/* the rest is just <number> (years|months|weeks|days|hours|minutes|seconds) */
123 126
	while (1) {
124 127
		char *space, *err;
125 128
		int num;
......
151 154
			} else if (slen == 6 &&
152 155
				   0 == strncmp(ts, "months", slen)) {
153 156
				num *= 60 * 60 * 24 * 30;
157
			} else if (slen == 5 &&
158
				   0 == strncmp(ts, "weeks", slen)) {
159
				num *= 60 * 60 * 24 * 7;
154 160
			} else if (slen == 4 &&
155 161
				   0 == strncmp(ts, "days", slen)) {
156 162
				num *= 60 * 60 * 24;
......
177 183
				num *= 60 * 60 * 24 * 30 * 12;
178 184
			} else if (0 == strcmp(ts, "months")) {
179 185
				num *= 60 * 60 * 24 * 30;
186
			} else if (0 == strcmp(ts, "weeks")) {
187
				num *= 60 * 60 * 24 * 7;
180 188
			} else if (0 == strcmp(ts, "days")) {
181 189
				num *= 60 * 60 * 24;
182 190
			} else if (0 == strcmp(ts, "hours")) {
    (1-1/1)