Same bug in Menuconfig...

Larry M. Augustin (lma@varesearch.com)
Wed, 4 Jun 1997 14:43:47 -0700


The expr problems shows up in Menuconfig too. Can't change integer
values in 2.0.30. Works on older expr, but not newer (As opposed to
Configure, which worked on newer but not older...) Anyway, here's the
same patch for Menuconfig.

Larry

--- Menuconfig~ Tue Oct 29 07:38:17 1996
+++ Menuconfig Wed Jun 4 14:37:06 1997
@@ -20,6 +20,8 @@
# script.
#
# Please send comments / questions / bug fixes to roadcapw@cfw.com
+# 040697 Larry Augustin (lma@varesearch.com) - integer expr test
+# fails with GNU expr 1.15 or newer. Re-write to work with new or old expr.
#
#----------------------------------------------------------------------------

@@ -389,6 +391,12 @@
#
# Create a dialog for entering an integer into a kernel option.
#
+OLD_EXPR=`expr "0" : '0\?'`
+if [ $OLD_EXPR -eq 1 ]; then
+ INT_EXPR='0$\|-\?[1-9][0-9]*$'
+else
+ INT_EXPR='0$\|-?[1-9][0-9]*$'
+fi
function l_int () {
while true
do
@@ -400,7 +408,7 @@
answer="`cat MCdialog.out`"
answer="${answer:-$3}"

- if expr $answer : '0$\|-?[1-9][0-9]*$' >/dev/null
+ if expr $answer : $INT_EXPR >/dev/null
then
eval $2="$answer"
else