patch-2.1.27 linux/scripts/Configure

Next file: linux/Documentation/Changes
Previous file: linux/net/x25/x25_in.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.26/linux/scripts/Configure linux/scripts/Configure
@@ -1,3 +1,4 @@
+
 #! /bin/sh
 #
 # This script is used to configure the linux kernel.
@@ -56,6 +57,16 @@
 # Enable function cacheing.
 set -f -h
 
+# Newer shellutils have a more POSIX compliant behavior which is
+# sadly not backward compatible.
+if expr "$(expr --version)" : '.*1\.1[56]' > /dev/null; then
+   INT_FILTER='0$\|-\?[1-9][0-9]*$'
+   HEX_FILTER='[0-9a-fA-F]\+$'
+else
+   INT_FILTER='0$\|-?[1-9][0-9]*$'
+   HEX_FILTER='[0-9a-fA-F]+$'
+fi
+
 #
 # Dummy functions for use with a config.in modified for menuconf
 #
@@ -288,7 +299,7 @@
 	def=${old:-$3}
 	while :; do
 	  readln "$1 ($2) [$def] " "$def" "$old"
-	  if expr "$ans" : '0$\|-\?[1-9][0-9]*$' > /dev/null; then
+	  if expr "$ans" : $INT_FILTER > /dev/null; then
 	    define_int "$2" "$ans"
 	    break
 	  else
@@ -319,7 +330,7 @@
 	while :; do
 	  readln "$1 ($2) [$def] " "$def" "$old"
 	  ans=${ans#*[x,X]}
-	 if expr "$ans" : '[0-9a-fA-F]\+$' > /dev/null; then
+	 if expr "$ans" : $HEX_FILTER > /dev/null; then
 	   define_hex "$2" "$ans"
 	   break
 	 else


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov