mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +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
|
||||
local mounts=( )
|
||||
local mount
|
||||
while IFS=$'\n' read mount; do
|
||||
while IFS=$'\n' read -r mount; do
|
||||
# Do not care about local mounts
|
||||
[[ "$mount" =~ ^"file:" ]] && continue
|
||||
|
||||
@ -69,7 +69,7 @@ __gio_location() {
|
||||
local files=()
|
||||
local names=()
|
||||
local name size type
|
||||
while IFS=$'\t' read name size type; do
|
||||
while IFS=$'\t' read -r name size type; do
|
||||
# Escape name properly
|
||||
local escaped_name
|
||||
escaped_name="$(printf "%q" "$name")"
|
||||
|
Loading…
Reference in New Issue
Block a user