diff mbox series

[PATCHv2,2/4] scripts/clean-package.sh: use read -r

Message ID 20200711184528.47605-2-rosenp@gmail.com
State New
Headers show
Series [PATCHv2,1/4] scripts/clean-package.sh: exit in case cd fails | expand

Commit Message

Rosen Penev July 11, 2020, 6:45 p.m. UTC
read will mangle backslashes.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v2: rebased
 scripts/clean-package.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index cbd12d8799..4b536c8a48 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -10,14 +10,14 @@  IFS=$'\n'
 }
 cat "$1" | (
 	cd "$2" || exit 1
-	while read entry; do
+	while read -r entry; do
 		[ -n "$entry" ] || break
 		[ ! -d "$entry" ] || [ -L "$entry" ] && rm -f "$entry"
 	done
 )
 sort -r "$1" | (
 	cd "$2" || exit 1
-	while read entry; do
+	while read -r entry; do
 		[ -n "$entry" ] || break
 		[ -d "$entry" ] && rmdir "$entry" > /dev/null 2>&1
 	done