Roxen.git / server / etc / modules / Roxen.pmod

version» Context lines:

Roxen.git/server/etc/modules/Roxen.pmod:5944:    }    recur (dec_path);       if (!nonexist) {    // FIXME: Note that get_dir on windows accepts and returns    // unicode paths, so the following isn't correct there. The    // charset handling in the file system interface on windows is    // inconsistent however, since most other functions do not    // accept neither wide strings nor strings encoded with any    // charset. This applies at least up to pike 7.8.589. +  string name = basename(path);    search_dir:    if (array(string) dir_list = get_dir (enc_path)) {    string lc_name = basename (lc_path);    string dec_name, enc_name; -  +  int fail;       foreach (dir_list, string enc_ent) {    string dec_ent;    if (!decode)    dec_ent = enc_ent;    else if (mixed err = catch (dec_ent = decode (dec_ent))) {    if (!objectp (err) || !err->is_charset_decode_error)    throw (err);    // Ignore file system paths that we cannot decode.    continue;    }    if (String.width(dec_ent) > 8) {    dec_ent = Unicode.normalize(dec_ent, "NFC");    }       if (lower_case (dec_ent) == lc_name) {    if (dec_name) {    if (!no_warn)    report_warning ("Ambiguous path %q matches both %q and %q "    "in %q.\n", path, dec_name, dec_ent, dec_path); -  break search_dir; +  fail = 1;    }    dec_name = dec_ent;    enc_name = enc_ent; -  +  if (enc_ent == name) { +  fail = 0; +  break;    }    } -  +  }    -  if (dec_name) { +  if (dec_name && !fail) {    dec_path = combine_path_unix (dec_path, dec_name);    enc_path = combine_path (enc_path, enc_name);    //werror ("path %O -> %O/%O\n", path, dec_path, enc_path);    cache_set (cache_name, lc_path, dec_path);    return;    }    }       nonexist = 1;    }