git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: Fredrik Kuivinen <frekui@gmail.com>
Cc: git@vger.kernel.org, dpotapov@gmail.com,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 5/5] Use kwset in grep
Date: Mon, 22 Aug 2011 08:39:20 +0200	[thread overview]
Message-ID: <4E51F998.50801@gnu.org> (raw)
In-Reply-To: <20110820224218.GF2199@fredrik-Q430-Q530>

On 08/21/2011 12:42 AM, Fredrik Kuivinen wrote:
> +		if (opt->regflags&  REG_ICASE || p->ignore_case) {
> +			static char trans[256];
> +			int i;
> +			for (i = 0; i<  256; i++)
> +				trans[i] = tolower(i);
> +			p->kws = kwsalloc(trans);
> +		} else {
> +			p->kws = kwsalloc(NULL);
> +		}

Of course, this makes absolutely no sense for MB_CUR_MAX > 1.  It's 
worth mentioning that grep instead uses a loop with 
mbrtowc/towlower/wcrtomb.  This in turn will remove the need for the 
complex kwset code. :)

The "mbtolower" code" dates to after the license change, but I wrote it 
and I give permission to use it under GPLv2.  See commits 70e23616 and 
30af8050 in the GNU grep repository.

Should still be good enough for most uses, so I'll give my

Acked-by: Paolo Bonzini <bonzini@gnu.org>

Paolo

  reply	other threads:[~2011-08-22  6:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110820223032.12380.72469.stgit@localhost6.localdomain6>
2011-08-20 22:40 ` [PATCH v2 1/5] Add obstack.[ch] from EGLIBC 2.10 Fredrik Kuivinen
2011-08-20 22:41 ` [PATCH v2 2/5] Add string search routines from GNU grep Fredrik Kuivinen
2011-08-20 22:41 ` [PATCH v2 3/5] Adapt the kwset code to Git Fredrik Kuivinen
2011-08-20 22:41 ` [PATCH v2 4/5] Use kwset in pickaxe Fredrik Kuivinen
2011-08-20 22:42 ` [PATCH v2 5/5] Use kwset in grep Fredrik Kuivinen
2011-08-22  6:39   ` Paolo Bonzini [this message]
2011-08-28 11:31     ` Fredrik Kuivinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E51F998.50801@gnu.org \
    --to=bonzini@gnu.org \
    --cc=dpotapov@gmail.com \
    --cc=frekui@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).