summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-09-10 16:50:35 +0200
committerSimon Rettberg2019-09-10 16:50:35 +0200
commit9dfa19ff1067457b47eb301099fd84a11425ff5e (patch)
tree61719ad0c7b0af56cb2b3f64de86aeb094435ab6
parent[run-virt] Fix tr expressions, add some missing quotes (diff)
downloadmltk-9dfa19ff1067457b47eb301099fd84a11425ff5e.tar.gz
mltk-9dfa19ff1067457b47eb301099fd84a11425ff5e.tar.xz
mltk-9dfa19ff1067457b47eb301099fd84a11425ff5e.zip
[run-virt] Fix: Explicitly initialize empty arrays
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc2
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc6
2 files changed, 4 insertions, 4 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
index 85b4a96a..c080be8c 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
@@ -23,7 +23,7 @@ start_wm() {
# start RUNVIRT_DM determined above
writelog "Starting ${RUNVIRT_DM}."
- declare -a OPTS=
+ declare -a OPTS=()
case "$RUNVIRT_DM" in
openbox|kwin|xfwm4|metacity)
OPTS+=( "--replace" )
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
index e6337236..937905ab 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
@@ -91,7 +91,7 @@ $BODY"
# Only accepts functions that were not previously registered.
# This kinda detects when a cleanup function was overriden,
# or at least that something is fishy.
-declare -ag CLEANUP_TASKS
+declare -ag CLEANUP_TASKS=()
add_cleanup() {
[ $# -lt 1 ] && writelog "'${FUNCNAME[0]}' needs at least one argument! $# given." && return
# check if the given function name is already used
@@ -128,7 +128,7 @@ cleanexit() {
usleep 250000
local TASK
if [ "${#CLEANUP_TASKS[@]}" -gt 0 ]; then
- declare -a cleanups=
+ declare -a cleanups=()
declare -a copy=( "${CLEANUP_TASKS[@]}" )
unset CLEANUP_TASKS
for TASK in "${copy[@]}"; do
@@ -235,7 +235,7 @@ translate() {
# returns 100 if no hooks exist
run_hooks() {
local dir file retval r
- declare -a files
+ declare -a files=()
dir="$VMCHOOSER_DIR/hooks/${1}.d"
[ -d "$dir" ] || return 100
shift