lkml.org 
[lkml]   [1997]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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
instead.
The culprit is in function int() of Configure:

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

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: <philippe.strauss@urbanet.ch>
Homepage: http://sicel-home-1-4.urbanet.ch

"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.040 / U:7.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site