mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-09 01:04:06 +01:00
Fix if_match to only do wild-card patches on patters ending in '+'
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1233 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
20fbb4b12a
commit
6454d50051
@ -25,3 +25,5 @@ Changes since 2.0.0
|
||||
12) Fix item 10 above :-(
|
||||
|
||||
13) Replace good code with crap to satisfy 'ash'.
|
||||
|
||||
14) Fix if_match to only do wild-card matches on patterns ending in "+".
|
||||
|
@ -532,10 +532,19 @@ if_match() # $1 = Name in interfaces file - may end in "+"
|
||||
# $2 = Full interface name - may also end in "+"
|
||||
{
|
||||
local pattern=${1%+}
|
||||
local interface=${2%+}
|
||||
|
||||
# test "x${interface:0:${#pattern}}" = "x${pattern}"
|
||||
test "x$(echo ${interface} | cut -b -${#pattern} )" = "x${pattern}"
|
||||
|
||||
case $1 in
|
||||
*+)
|
||||
#
|
||||
# Can't use ${2:0:${#pattern}} because ash and dash don't support that flavor of
|
||||
# variable expansion :-(
|
||||
#
|
||||
test "x$(echo $2 | cut -b -${#pattern} )" = "x${pattern}"
|
||||
;;
|
||||
*)
|
||||
test "x$1" = "x$2"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user