[lkml]   [1997]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectscript/Configure screwed on integer param.
Until one of the latest ncrBsd ncr scsi driver, i had never
used an integer parameter for my kernel config, except for
sound, which is not revelant here.

With this ncrBsd driver, i pass two integer args, which the
configure script didnt recognize as int, but launch the help text
The culprit is in function int() of Configure:

function int () {
old=$(eval echo "\${$2}")
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
if expr "$ans" : '0$\|-?[1-9][0-9]*$' > /dev/null; then
define_int "$2" "$ans"
help "$2"

expr "$ans" : '0$\|-?[1-9][0-9]*$' always return 0 on my system,
whatever ans will be. I can't fully understand this regexp.
I can substitute it with something simpler, such as [[:digit:]]*,
though this is a leaky filter.

From expr(1):

expr returns the following exit status:

0 if the expression is neither null nor 0,
1 if the expression is null or 0,
2 for invalid expressions.

So the help "$2" is executed, whatever i type as an argument.
My shellutils is 1.16, debian rev. 1.

I suspect a change of the regexp matching behaviour of at least expr.

Anybody has seeing this, seeing it working with older sellutils,
hints, comment?

Philippe Strauss, ingenieur en telecommunications.

Email: <>

"An expert is a man who has made all the mistakes, which can be made, in
a very narrow field." -- Niels Henrik David Bohr

 \ /
  Last update: 2005-03-22 13:38    [W:0.064 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site