git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Riesen" <raa.lkml@gmail.com>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: "Git Mailing List" <git@vger.kernel.org>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH 2/2] grep: don't call regexec() for fixed strings
Date: Mon, 12 Jan 2009 16:32:36 +0100	[thread overview]
Message-ID: <81b0412b0901120732t1bd1978awdc4be47767e02863@mail.gmail.com> (raw)
In-Reply-To: <4967DB4A.2000702@lsrfire.ath.cx>

2009/1/10 René Scharfe <rene.scharfe@lsrfire.ath.cx>:
> +static int isregexspecial(int c)
> +{
> +       return isspecial(c) || c == '$' || c == '(' || c == ')' || c == '+' ||
> +                              c == '.' || c == '^' || c == '{' || c == '|';
> +}
> +
> +static int is_fixed(const char *s)
> +{
> +       while (!isregexspecial(*s))
> +               s++;
> +       return !*s;
> +}

strchr?

  parent reply	other threads:[~2009-01-12 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 23:08 [PATCH 1/2] grep -w: forward to next possible position after rejected match René Scharfe
2009-01-09 23:18 ` [PATCH 2/2] grep: don't call regexec() for fixed strings René Scharfe
2009-01-10 20:37   ` Junio C Hamano
2009-01-12 12:25   ` Mikael Magnusson
2009-01-12 13:33     ` Johannes Schindelin
2009-01-12 15:32   ` Alex Riesen [this message]
2009-01-12 19:18     ` René Scharfe
2009-01-13  8:13       ` Junio C Hamano
2009-01-17 15:50         ` [PATCH 1/4] Add ctype test René Scharfe
2009-01-17 15:50         ` [PATCH 2/4] Reformat ctype.c René Scharfe
2009-01-17 15:50         ` [PATCH 3/4] Change NUL char handling of isspecial() René Scharfe
2009-01-17 15:50         ` [PATCH 4/4] Add is_regex_special() René Scharfe

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=81b0412b0901120732t1bd1978awdc4be47767e02863@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).