remove_profiles(): Fix returning $retval
Extend the subshell so that the actual (possibly non-zero) value of $retval gets returned. Before, the changed value was lost at "done" (= leaving the subshell), and the initial $retval=0 was returned.
(found with shellcheck)
Ignoring the whitespace fixes, the diff is:
- while ... return $retval
+ { while ... return $retval }
I propose this fix for 2.11..master