lkml.org 
[lkml]   [2009]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5 v2] tracing/filters: Provide basic regex support
On Fri, Sep 25, 2009 at 12:13:45PM +0400, Andrey Panin wrote:
> On 267, 09 24, 2009 at 09:49:34PM +0200, Frederic Weisbecker wrote:
> > This patch provides basic support for regular expressions in filters.
>
> > +/* Basic regex callbacks */
> > +static int regex_match_full(char *str, struct regex *r, int len)
> > +{
> > + if (strncmp(str, r->pattern, len) == 0)
> > + return 1;
> > + return 0;
> > +}
> > +
> > +static int regex_match_front(char *str, struct regex *r, int len)
> > +{
> > + if (strncmp(str, r->pattern, len) == 0)
> > + return 1;
> > + return 0;
> > +}
>
> These two functions are identical, what's the reason to keep them separate ?
> And why not simply return strncmp(str, r->pattern, len) == 0 ?


Good catch! I'll fix that, thanks.



\
 
 \ /
  Last update: 2009-09-25 10:19    [W:0.194 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site