From 96ebf7ba145a57366789b3f4d07afd687b82c413 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 18 May 2013 14:14:22 +0200 Subject: [PATCH] modem: Fix getting provider information. If there were spaces in the output string, the string has not been correctly parsed. --- functions.modem | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/functions.modem b/functions.modem index 8b78478c..1960ee64 100644 --- a/functions.modem +++ b/functions.modem @@ -391,12 +391,30 @@ function __modem_get_network_operator() { assert_check_retval $? output=${output#*: } - - local mode format operator act - read mode format operator act <<< "${output//,/ }" - - # Remove all " from the operator string. - operator=${operator//\"/} + output=${output//,/ } + + local arg mode format operator act + local i=0 + while read -r arg; do + case "${i}" in + 0) + mode="${arg}" + ;; + 1) + format="${arg}" + ;; + 2) + operator="$(strip ${arg})" + ;; + 3) + act="${arg}" + ;; + *) + break + ;; + esac + i="$(( ${i} + 1 ))" + done <<< "$(args ${output})" print "${!argument}" return ${EXIT_OK} -- 2.47.2