[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#697017: root=compute fails at parse_numeric() for lilo compatibility



On Sun, 30 Dec 2012 21:28:33 -0500 (EST), Jonathan Nieder wrote:
> 
> How about this patch?
> ...

I like your patch better.  It is more general and solves the more general problem
of non-numeric strings being treated like numeric strings.  Whenever I see
something which includes a bracketed expression, such as [0-9]*, I tend to think
"regular expressions".  And apparently, the original author did too.  In a regular
expression, "[0-9]*" means "a string of zero or more numeric digits somewhere in
the complete string".  ( "^[0-9]*$" would mean the complete string is numeric or is
the null string.)  But these are not regular expressions, these are shell patterns.
As a shell pattern, [0-9]* means "a single numeric digit at the beginning of the
string followed by zero or more arbitrary characters".  Your patch solves the more
general problem.
  
-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


Reply to: