From 5c28e4167757eeaef722b1e2a88797266c013259 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 5 Oct 2017 10:59:22 +0100 Subject: [PATCH] shutils: fix read_tree_values My bash fu was off on my previous list. The output of find was being treated as a single string, rather than an array of paths; which ment that the test that there was more than one path returned failed, resulting in null output not just for empty directories but for everyting. This fixes the issue by converting find output to an array. --- devlib/bin/scripts/shutils.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devlib/bin/scripts/shutils.in b/devlib/bin/scripts/shutils.in index 401e51e..024e891 100755 --- a/devlib/bin/scripts/shutils.in +++ b/devlib/bin/scripts/shutils.in @@ -221,9 +221,9 @@ read_tree_values() { exit 1 fi - PATHS=$($BUSYBOX find $PATH -follow -maxdepth $MAXDEPTH) + PATHS=($($BUSYBOX find $PATH -follow -maxdepth $MAXDEPTH)) if [ ${#PATHS[@]} -gt 1 ]; then - $BUSYBOX grep -s '' $PATHS + $BUSYBOX grep -s '' ${PATHS[@]} fi }