From 0917319ae9e9e5ba2f1ba623ba65de116ead3814 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 29 Jan 2006 20:49:16 +0000 Subject: [PATCH] Speed up compilation git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3404 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/compiler | 6 +----- Shorewall/functions | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Shorewall/compiler b/Shorewall/compiler index a456a7cf8..ccf7b9644 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -8306,16 +8306,12 @@ compile_firewall() # $1 = File Name outfile=$1 dir= # - # Overload a couple of functions from the library + # Overload a function from the library # deletechain() # $1 = name of chain { save_command "qt \$IPTABLES -L $1 -n && qt \$IPTABLES -F $1 && qt \$IPTABLES -X $1" } - - fix_bang() { - echo $@ | sed 's/!/! /g' - } # # END OVERLOADED FUNCTIONS # diff --git a/Shorewall/functions b/Shorewall/functions index 6c5914cb7..803dbe87a 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -118,22 +118,25 @@ expandv() # $* = list of variable names } # -# Replace all leading "!" with "! " in the passed argument list +# Add whitespace after "!" # +fix_bang() +{ + local result= -fix_bang() { - local i; - - for i in $@; do - case $i in + while [ $# -gt 0 ]; do + case $1 in !*) - echo "! ${i#!}" + result="$result ! ${1#!}" ;; *) - echo $i + result="$result $1" ;; esac + shift done + + echo $result } #