lkml.org 
[lkml]   [2011]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch v4] checkpatch: Signature format verification
From
Date
On Sat, 2011-05-28 at 00:47 +0530, anish singh wrote:
> On Sat, May 28, 2011 at 12:38 AM, Joe Perches <joe@perches.com> wrote:
> On Sat, 2011-05-28 at 00:28 +0530, Manish Kumar Singh wrote:
> > For the 3rd time, please use this form:
> > if ($line =~ /^(\s*)($ValidSignatures)(\s*)(.*)$/i) {
> > and if you really want email format validation,
> > use a separate function.
> []
> > Problem with your way of doing is if anyone misses space
> between
> > "sign" & name,
> > the regular expression
> (/^(\s*)($ValidSignatures)(\s*)(.*)$/i )
> > doesn't match
> That's incorrect. Try it.

Anish, do you have a response to this?

> I have replaced b/w with "between".
> And as Manish rightly exlained this patch is not meant for
> email validation.

Yet it does incorrectly anyway to nominally skip
name and find <.*>. That's the problem.

Look again at the patterns:

+ if ($line =~ /^\s*$sign(.*)/i) {
+ if ($1 !~ /^\s+([a-zA-Z\s\"\.\-\'\,]*.*)/i) {
+ WARN("Space required after $sign\n" .
+ $herecurr);
+ }

and

+ if ($1 !~ /([\sa-zA-Z\"\.\-\'\,]*)\s<.*>/i) {
+ WARN("Space required b/w Full Name & Mail-id:\n" .
+ $herecurr);
+ }

> I would like to know if anything else is missing?

Correctness.

Keep at it, it'll eventually be good to go.

cheers, Joe



\
 
 \ /
  Last update: 2011-05-27 21:35    [W:0.057 / U:16.588 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site