From 9be91cd8e3ad041c3c067a33d0ee104f6f375438 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 12 Dec 2016 17:59:54 +1100 Subject: [PATCH] Scrot: Quote unquoted var --- neofetch | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index c9271f09..2a8be65d 100755 --- a/neofetch +++ b/neofetch @@ -88,6 +88,7 @@ get_distro() { else # Source the os-release file for file in /etc/os-release /usr/lib/os-release /etc/*release /usr/lib/*release; do + # shellcheck disable=1090 source "$file" && break done @@ -2392,22 +2393,22 @@ scrot_program() { # falling back to OS specific screenshot tools. if [[ -n "$DISPLAY" ]]; then if [[ "$scrot_cmd" != "auto" ]] && type -p "$scrot_cmd" >/dev/null; then - scrot_program="$scrot_cmd" + scrot_program=("$scrot_cmd") elif type -p scrot >/dev/null; then - scrot_program="scrot" + scrot_program=(scrot) elif type -p maim >/dev/null; then - scrot_program="maim" + scrot_program=(maim) elif type -p import >/dev/null; then - scrot_program="import -window root" + scrot_program=(import -window root) elif type -p imlib2_grab >/dev/null; then - scrot_program="imlib2_grab" + scrot_program=(imlib2_grab) elif type -p gnome-screenshot >/dev/null; then - scrot_program="gnome-screenshot -f" + scrot_program=(gnome-screenshot -f) else err "Scrot: No screen capture tool found." @@ -2415,15 +2416,15 @@ scrot_program() { fi else case "$os" in - "Mac OS X") scrot_program="screencapture -S" ;; - "Haiku") scrot_program="screenshot -s" ;; + "Mac OS X") scrot_program=(screencapture -S) ;; + "Haiku") scrot_program=(screenshot -s) ;; esac fi # Take the scrot. - $scrot_program "$1" + "${scrot_program[@]}" "$1" - err "Scrot: Screen captured using $scrot_program" + err "Scrot: Screen captured using ${scrot_program[0]}" } # TEXT FORMATTING