address the old bash/dir_init() part of issue 55

r845 addresses part of a problem with sbopkg code and bash 3x array
handling but not all of it. When creating an array with the += operator,
if the array creation code was triggered, the item doing so should have
been assigned to index 0 and, instead, an empty string was being
assigned to 0 and the item was being assigned to index 1, resulting in a
blank line being output before the proper item. Thanks to greinze for
pointing this out. Explicitly declaring the variable an array seems to
solve this.
This commit is contained in:
slakmagik 2011-01-21 05:48:07 +00:00
parent 5c2ae15a42
commit 50a005bc3e

View File

@ -252,7 +252,8 @@ dir_init() {
# Check to make sure certain sbopkg-related directories exist. # Check to make sure certain sbopkg-related directories exist.
# If not, create them. # If not, create them.
local DIR_VARS DI_OUTPUT_LINES DIRS2MK DI_OUTPUT REPLY ERROR local -a DIR_VARS DI_OUTPUT_LINES DI_OUTPUT
local DIRS2MK REPLY ERROR
# Keep DIR_VARS and DI_OUTPUT_LINES in sync where REPO_DIR ~ REPO_ROOT. # Keep DIR_VARS and DI_OUTPUT_LINES in sync where REPO_DIR ~ REPO_ROOT.