From 50a005bc3e12756b500b3b4d7e2299ca4c15fdb0 Mon Sep 17 00:00:00 2001 From: slakmagik Date: Fri, 21 Jan 2011 05:48:07 +0000 Subject: [PATCH] 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. --- src/usr/sbin/sbopkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 14c070e..af4d02b 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -252,7 +252,8 @@ dir_init() { # Check to make sure certain sbopkg-related directories exist. # 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.