[arch-projects] [initscripts] [PATCH 3/3] functions: Make in_array() non DAEMONS specific

Kurt J. Bosch kjb-temp-2009 at alpenjodel.de
Mon Jul 11 11:34:42 EDT 2011


For checking whether a daemon is started via the DAEMONS array we use ck_autostart() now.
So make in_array() generic as the name suggests instead of removing '@'-prefixes from array members behind ones back.

Suggested-by: Dave Reisner <d at falconindy.com>
---
 functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/functions b/functions
index f564f3d..000ee0e 100644
--- a/functions
+++ b/functions
@@ -169,7 +169,7 @@ in_array() {
 	local needle=$1; shift
 	local item
 	for item; do
-		[[ ${item#@} = $needle ]] && return 0
+		[[ $item = $needle ]] && return 0
 	done
 	return 1 # Not Found
 }
-- 
1.7.1



More information about the arch-projects mailing list