From owner-cvs-src@FreeBSD.ORG Mon May 16 19:35:07 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23DE216A4CE; Mon, 16 May 2005 19:35:07 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2B4243D9A; Mon, 16 May 2005 19:35:05 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j4GJfKex033404; Mon, 16 May 2005 22:41:20 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 69335-16; Mon, 16 May 2005 22:34:58 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j4GJfJnp033398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 May 2005 22:41:19 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.3/8.13.3) id j4GJZGOr039974; Mon, 16 May 2005 22:35:16 +0300 (EEST) (envelope-from ru) Date: Mon, 16 May 2005 22:35:16 +0300 From: Ruslan Ermilov To: Andrey Chernov , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-ID: <20050516193516.GA14960@ip.net.ua> References: <200505161911.j4GJBdQS034729@repoman.freebsd.org> <20050516192505.GA11854@nagual.pp.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O5XBE6gyVG5Rl6Rj" Content-Disposition: inline In-Reply-To: <20050516192505.GA11854@nagual.pp.ru> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua Subject: Re: cvs commit: src/contrib/one-true-awk - Imported sources X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 19:35:07 -0000 --O5XBE6gyVG5Rl6Rj Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 16, 2005 at 11:25:05PM +0400, Andrey Chernov wrote: > On Mon, May 16, 2005 at 07:11:39PM +0000, Ruslan Ermilov wrote: > > ru 2005-05-16 19:11:39 UTC > >=20 > > FreeBSD src repository > >=20 > > src/contrib/one-true-awk - Imported sources > > Update of /home/ncvs/src/contrib/one-true-awk > > In directory repoman.freebsd.org:/tmp/cvs-serv34626 > > =20 > > Log Message: > > Vendor import of bwk's 24-Apr-2005 release. >=20 > Is it fix [a-z]-type collating ranges? Even GNU regex now honors it=20 > natively. >=20 Nope, but I still keep the patches locally (attached). Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Index: b.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/contrib/one-true-awk/b.c,v retrieving revision 1.1.1.8 diff -u -p -r1.1.1.8 b.c --- b.c 16 May 2005 19:11:31 -0000 1.1.1.8 +++ b.c 16 May 2005 19:33:25 -0000 @@ -282,9 +282,21 @@ int quoted(char **pp) /* pick up next th return c; } =20 +static int collate_range_cmp(int a, int b) +{ + static char s[2][2]; + + if ((uschar)a =3D=3D (uschar)b) + return 0; + s[0][0] =3D a; + s[1][0] =3D b; + return (strcoll(s[0], s[1])); +} + char *cclenter(const char *argp) /* add a character class */ { int i, c, c2; + int j; uschar *p =3D (uschar *) argp; uschar *op, *bp; static uschar *buf =3D 0; @@ -303,15 +315,18 @@ char *cclenter(const char *argp) /* add=20 c2 =3D *p++; if (c2 =3D=3D '\\') c2 =3D quoted((char **) &p); - if (c > c2) { /* empty; ignore */ + if (collate_range_cmp(c, c2) > 0) { bp--; i--; continue; } - while (c < c2) { + for (j =3D 0; j < NCHARS; j++) { + if ((collate_range_cmp(c, j) > 0) || + collate_range_cmp(j, c2) > 0) + continue; if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, 0)) FATAL("out of space for character class [%.10s...] 2", p); - *bp++ =3D ++c; + *bp++ =3D j; i++; } continue; Index: main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/contrib/one-true-awk/main.c,v retrieving revision 1.1.1.10 diff -u -p -r1.1.1.10 main.c --- main.c 16 May 2005 19:11:31 -0000 1.1.1.10 +++ main.c 16 May 2005 19:33:25 -0000 @@ -58,6 +58,7 @@ int main(int argc, char *argv[]) const char *fs =3D NULL; =20 setlocale(LC_CTYPE, ""); + setlocale(LC_COLLATE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname =3D argv[0]; if (argc =3D=3D 1) { Index: run.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/contrib/one-true-awk/run.c,v retrieving revision 1.1.1.8 diff -u -p -r1.1.1.8 run.c --- run.c 16 May 2005 19:11:35 -0000 1.1.1.8 +++ run.c 16 May 2005 19:33:36 -0000 @@ -651,7 +651,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[ j =3D x->fval - y->fval; i =3D j<0? -1: (j>0? 1: 0); } else { - i =3D strcmp(getsval(x), getsval(y)); + i =3D strcoll(getsval(x), getsval(y)); } tempfree(x); tempfree(y); --YZ5djTAD1cGYuMQK-- --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCiPX0qRfpzJluFF4RAr9fAKCXbdZmi95T9QevkyLc8hf5t51TdwCeNrHE JGBMpGkrsNzyHvzHKiXCMIM= =bqd9 -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj--