From: Peter Palfrader Date: Fri, 16 Jan 2009 21:46:08 +0000 (+0100) Subject: Deleting members while we do an .each on an array is not good X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b9753fc5301d2c8bb13dfbb2fb01bb63e9d01fe;p=pwstore Deleting members while we do an .each on an array is not good --- diff --git a/pws b/pws index b58ea38..e73d036 100755 --- a/pws +++ b/pws @@ -326,7 +326,8 @@ class GroupConfig group['keys'] = [] unless group['keys'] still_contains_groups = false - group['members_to_do'].each do |member| + group['members_to_do'].clone.each do |member| + puts "member: #{member}" if is_group(member) if @groups[member]['members_to_do'].size == 0 group['keys'].concat @groups[member]['keys']