bash backend - handdle nil lines better

This commit is contained in:
Carsten Haitzler 2023-10-23 21:59:17 +01:00
parent b9fe017968
commit d1aa1a6635
1 changed files with 4 additions and 1 deletions

View File

@ -55,11 +55,14 @@ function e_val_escape() {
function e_line_read() {
local -n V=${1}
local PIFS="$IFS"
local C
IFS=" "
read -a V
IFS="$PIFS"
# check command line starts with CMD
if [ ${V[0]} != "CMD" ]; then return 1; fi
C=${V[0]}
if test -z "$C"; then return 1; fi
if [ ${C} != "CMD" ]; then return 1; fi
return 0
}