Make 'resolve_file' handle ../ correctly; remove hacks to keep Kate from getting lost

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4186 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-06-30 20:30:05 +00:00
parent fe221c8d6e
commit 3db2166e12
2 changed files with 12 additions and 16 deletions

View File

@ -694,28 +694,24 @@ iprange_echo()
# #
get_set_flags() # $1 = set name and optional [levels], $2 = src or dst get_set_flags() # $1 = set name and optional [levels], $2 = src or dst
{ {
#
# Note: There is a lot of unnecessary evaluation in this function just so my text
# editor (kate) doesn't get lost trying to follow the shell syntax for highlighting.
#
local temp setname=$1 options=$2 local temp setname=$1 options=$2
[ -n "$IPSET_MATCH" ] || fatal_error "Your kernel and/or iptables does not include ipset match: $1" [ -n "$IPSET_MATCH" ] || fatal_error "Your kernel and/or iptables does not include ipset match: $1"
case $1 in case $1 in
*\[[1-6]\]) *\[[1-6]\])
eval temp='${1#*\[}' temp=${1#*\[}
eval temp='${temp%\]}' temp=${temp%\]}
eval setname='${1%\[*}' setname=${1%\[*}
while [ $temp -gt 1 ]; do while [ $temp -gt 1 ]; do
options="$options,$2" options="$options,$2"
temp=$(($temp - 1)) temp=$(($temp - 1))
done done
;; ;;
*\[*\]) *\[*\])
eval options='${1#*\[}' options=${1#*\[}
eval options='${options%\]}' options=${options%\]}
eval setname='${1%\[*}' setname=${1%\[*}
;; ;;
*) *)
;; ;;

View File

@ -270,7 +270,7 @@ resolve_file() # $1 = file name
;; ;;
../*) ../*)
cd .. cd ..
echo ${PWD}${1#..} resolve_file ${1#../}
cd $pwd cd $pwd
;; ;;
*) *)
@ -320,12 +320,12 @@ separate_list() {
*\[*\]*) *\[*\]*)
# #
# Where we need to embed comma-separated lists within lists, we enclose them # Where we need to embed comma-separated lists within lists, we enclose them
# within square brackets (extra 'evals' are to keep my text editor (kate) from getting lost). # within square brackets.
# #
eval 'firstpart=${list%%\[*}' firstpart=${list%%\[*}
eval 'lastpart=${list#*\[}' lastpart=${list#*\[}
eval 'enclosure=${lastpart%%\]*}' enclosure=${lastpart%%\]*}
eval 'lastpart=${lastpart#*\]}' lastpart=${lastpart#*\]}
case $lastpart in case $lastpart in
\,*) \,*)
case $firstpart in case $firstpart in