From 80a6dbbe9fd6170e767ae317ec6e32791524fe3a Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Mon, 22 Jun 2020 18:38:15 +0200 Subject: [PATCH] more save split to array --- bashbot.sh | 11 ++--------- modules/background.sh | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index fd85ca0..00b6123 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -11,7 +11,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.98-dev-66-gd52ea8c +#### $$VERSION$$ v0.98-dev-67-g4fe9697 # # Exit Codes: # - 0 sucess (hopefully) @@ -839,14 +839,7 @@ process_message() { [[ "${SERVICE[*]}" =~ ^[[:blank:]]*$ ]] || SERVICE[0]="yes" # split message in command and args - CMD=( ) - if [[ "${MESSAGE[0]}" == "/"* ]]; then - set -f; unset IFS - # shellcheck disable=SC2206 - CMD=( ${MESSAGE[0]} ) - CMD[0]="${CMD[0]%%@*}" - set +f - fi + [ "${MESSAGE[0]:0:1}" = "/" ] && read -r CMD <<<"${MESSAGE[0]}" && CMD[0]="${CMD[0]%%@*}" } ######################### diff --git a/modules/background.sh b/modules/background.sh index 2172fbc..cf0d6c6 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.98-dev-66-gd52ea8c +#### $$VERSION$$ v0.98-dev-67-g4fe9697 # will be automatically sourced from bashbot