commit a5b3a9728ed3ac1ef1908260d35f0fe86c98362d
parent 0d354499f3051be3b72a2bf2d2e46d0c57663fab
Author: Sotiris Papatheodorou <sotiris@papatheodorou.xyz>
Date: Mon, 16 Aug 2021 00:35:59 +0300
Add missing -r to read
SC2162: read without -r will mangle backslashes
https://github.com/koalaman/shellcheck/wiki/SC2162
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/astro b/astro
@@ -49,7 +49,7 @@ version() {
# Parameters: url
parseurl() {
[ "$debug" ] && echo "Parsing: $1" >&2 && sleep 2
- IFS='|' read proto hostport path rest << EOF
+ IFS='|' read -r proto hostport path rest << EOF
$(echo "$1" | sed -E 's@^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?@\2\|\4\|\5\|\7@g')
EOF
@@ -63,7 +63,7 @@ EOF
path=
fi
- IFS=':' read host port << EOF
+ IFS=':' read -r host port << EOF
$hostport
EOF
@@ -249,7 +249,7 @@ fetch() {
url="$(sed "${i}q;d" "$cachedir/bookmarks" | cut -d' ' -f1)"
esac
- read proto host port path << EOF
+ read -r proto host port path << EOF
$(host="$2" parseurl "$url")
EOF
fetch "$proto" "$host" "$port" "$path"