git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 5/5] Use kwset in grep

From
Paolo Bonzini <bonzini@gnu.org>
Date
Aug 22, 2011, 06:39 UTC
Message-ID
<4E51F998.50801@gnu.org>
In-Reply-To
<20110820224218.GF2199@fredrik-Q430-Q530>
On 08/21/2011 12:42 AM, Fredrik Kuivinen wrote:
Show 9 quoted lines
> +		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
Previous: Fredrik KuivinenNext: Fredrik Kuivinen
Message 6 of 7 in “Add obstack.[ch] from EGLIBC 2.10”
  1. 1/5 Add obstack.[ch] from EGLIBC 2.10Fredrik Kuivinen, Aug 20, 2011
  2. 2/5 Add string search routines from GNU grepFredrik Kuivinen, Aug 20, 2011
  3. 3/5 Adapt the kwset code to GitFredrik Kuivinen, Aug 20, 2011
  4. 4/5 Use kwset in pickaxeFredrik Kuivinen, Aug 20, 2011
  5. 5/5 Use kwset in grepFredrik Kuivinen, Aug 20, 2011
  6. Paolo BonziniAug 22, 2011
  7. Fredrik KuivinenAug 28, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.