Skip to content

Commit

Permalink
declare all vars at the top of a function. and use declare, not local
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Apr 29, 2011
1 parent 80edf1c commit d5614cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions geninit
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ __build_image() { # {{{
} # }}}

__build_preset() { # {{{
local preset= presetfile=$_sysconfdir/geninit.d/$1.preset
local -a presets
declare preset= presetfile=$_sysconfdir/geninit.d/$1.preset
declare var= cfg= opts= imagename=
declare -a presets

if [[ ! -f $basedir$presetfile ]]; then
err "preset not found: $1"
Expand All @@ -238,8 +239,6 @@ __build_preset() { # {{{
return $EACCES
fi

local var= cfg= opts= imagename=

# preset pulls in a known array 'presets'
for preset in "${presets[@]}"; do
# resolve kernel version
Expand Down

0 comments on commit d5614cb

Please sign in to comment.