mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
completion: Use read -r
rather then plain read
This means that backslashes in the input (which is unlikely, but I guess possible) won’t affect line splitting. Spotted by shellcheck. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
b1ef6a125e
commit
7ad93a0c95
@ -53,7 +53,7 @@ __gio_location() {
|
|||||||
# List volumes and mounts
|
# List volumes and mounts
|
||||||
local mounts=( )
|
local mounts=( )
|
||||||
local mount
|
local mount
|
||||||
while IFS=$'\n' read mount; do
|
while IFS=$'\n' read -r mount; do
|
||||||
# Do not care about local mounts
|
# Do not care about local mounts
|
||||||
[[ "$mount" =~ ^"file:" ]] && continue
|
[[ "$mount" =~ ^"file:" ]] && continue
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ __gio_location() {
|
|||||||
local files=()
|
local files=()
|
||||||
local names=()
|
local names=()
|
||||||
local name size type
|
local name size type
|
||||||
while IFS=$'\t' read name size type; do
|
while IFS=$'\t' read -r name size type; do
|
||||||
# Escape name properly
|
# Escape name properly
|
||||||
local escaped_name
|
local escaped_name
|
||||||
escaped_name="$(printf "%q" "$name")"
|
escaped_name="$(printf "%q" "$name")"
|
||||||
|
Loading…
Reference in New Issue
Block a user