Received: by taz.hyperreal.com (8.7.5/V2.0) id MAA05301; Thu, 15 Aug 1996 12:27:03 -0700 (PDT) Received: by taz.hyperreal.com (8.7.5/V2.0) id MAA05289; Thu, 15 Aug 1996 12:27:01 -0700 (PDT) Date: Thu, 15 Aug 1996 12:27:01 -0700 (PDT) From: Alexei Kosut Message-Id: <199608151927.MAA05289@taz.hyperreal.com> To: apache-cvs@hyperreal.com Subject: cvs commit: apache/src mod_negotiation.c Sender: owner-apache-cvs@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com akosut 96/08/15 12:27:00 Modified: src mod_negotiation.c Log: Make language subtag matching work in both directions correctly. Revision Changes Path 1.14 +6 -2 apache/src/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C3 -r1.13 -r1.14 *** mod_negotiation.c 1996/08/15 19:22:38 1.13 --- mod_negotiation.c 1996/08/15 19:26:59 1.14 *************** *** 761,767 **** /* Finding languages. Note that we only match the substring specified * by the Accept: line --- this is to allow "en" to match all subvariants ! * of English. * * Again, strcmp() is legit because we've ditched case already. */ --- 761,768 ---- /* Finding languages. Note that we only match the substring specified * by the Accept: line --- this is to allow "en" to match all subvariants ! * of English. We then do it in the other direction, so that all ! * subvariants of English match "en". * * Again, strcmp() is legit because we've ditched case already. */ *************** *** 776,784 **** accs = (accept_rec *)accept_langs->elts; ! for (i = 0; i < accept_langs->nelts; ++i) if (!strncmp (lang, accs[i].type_name, strlen(accs[i].type_name))) return i; return -1; } --- 777,788 ---- accs = (accept_rec *)accept_langs->elts; ! for (i = 0; i < accept_langs->nelts; ++i) { if (!strncmp (lang, accs[i].type_name, strlen(accs[i].type_name))) return i; + if (!strncmp (lang, accs[i].type_name, strlen(lang))) + return i; + } return -1; }