[patch] 2.3.51 oddity in expr (scripts/Menuconfig)

From: david parsons (orc@pell.portland.or.us)
Date: Tue Mar 14 2000 - 14:45:46 EST


GNU expr and BSD expr seem to have fairly different ways of handling
patterns for the `:' operator -- the GNU style of using '\|' to split
patterns doesn't seem to work on BSD exprs, and the BSD style of using
'|' doesn't work on GNU (tested on an Irix box, Mastodon, SLS, and a
Solaris box.) I believe this patch actually will work on both flavors
of expr, and help preserve the cosmic balance of the world.

              ____
david parsons \bi/ Dilute! Dilute!
               \/

--- ./scripts/Menuconfig.orig Sun Feb 20 20:13:10 2000
+++ ./scripts/Menuconfig Sat Mar 11 08:49:14 2000
@@ -545,7 +545,7 @@
 
                         # Semantics of + and ? in GNU expr changed, so
                         # we avoid them:
- if expr "$answer" : '0$\|-[1-9][0-9]*$\|[1-9][0-9]*$' >/dev/null
+ if expr "$answer" : '0$' '|' "$answer" : '[1-9][0-9]*$' '|' "$answer" : '-[1-9][0-9]*$' >/dev/null
                         then
                                 eval $2="$answer"
                         else

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:29 EST