~ubuntu-branches/debian/squeeze/nginx/squeeze

« back to all changes in this revision

Viewing changes to src/http/modules/ngx_http_autoindex_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-11-08 09:53:46 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20091108095346-yt4eypw2l176tl53
Tags: 0.7.63-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
    ngx_int_t                       rc, size;
146
146
    ngx_str_t                       path;
147
147
    ngx_dir_t                       dir;
148
 
    ngx_uint_t                      i, level;
 
148
    ngx_uint_t                      i, level, utf8;
149
149
    ngx_pool_t                     *pool;
150
150
    ngx_time_t                     *tp;
151
151
    ngx_chain_t                     out;
252
252
    filename = path.data;
253
253
    filename[path.len] = '/';
254
254
 
 
255
    if (r->headers_out.charset.len == 5
 
256
        && ngx_strncasecmp(r->headers_out.charset.data, (u_char *) "utf-8", 5)
 
257
           == 0)
 
258
    {
 
259
        utf8 = 1;
 
260
 
 
261
    } else {
 
262
        utf8 = 0;
 
263
    }
 
264
 
255
265
    for ( ;; ) {
256
266
        ngx_set_errno(0);
257
267
 
335
345
        entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len,
336
346
                                           NGX_ESCAPE_HTML);
337
347
 
338
 
        if (r->utf8) {
 
348
        if (utf8) {
339
349
            entry->utf_len = ngx_utf8_length(entry->name.data, entry->name.len);
340
350
        } else {
341
351
            entry->utf_len = len;
622
632
 
623
633
    conf = ngx_palloc(cf->pool, sizeof(ngx_http_autoindex_loc_conf_t));
624
634
    if (conf == NULL) {
625
 
        return NGX_CONF_ERROR;
 
635
        return NULL;
626
636
    }
627
637
 
628
638
    conf->enable = NGX_CONF_UNSET;