summaryrefslogtreecommitdiff
path: root/qutebrowser/.local/share
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/.local/share')
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw8
1 files changed, 4 insertions, 4 deletions
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw b/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw
index 9bd6795..87ee28b 100755
--- a/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw
@@ -2,17 +2,17 @@
DEFAULT_SEARCH=startpage
-if [[ $1 =~ ^-.$ ]]; then
+if [[ "$1" =~ ^-.$ ]]; then
option="$1"
shift 1
fi
is_elvi=$(surfraw -elvi | grep -c "^$1\s")
-nbr_words=$(echo $1 | wc -w)
+nbr_words=$(echo "$1" | wc -w)
-if [[ $is_elvi -eq 0 && $nbr_words -eq 1 && ($1 == *.* || $1 == *:*) ]]; then
+if [[ $is_elvi -eq 0 && $nbr_words -eq 1 && ("$1" == *.* || "$1" == *:*) ]]; then
url="$1"
-else
+else
[[ $is_elvi -eq 0 ]] && sr="$DEFAULT_SEARCH $*" || sr=$*
url=$(surfraw -print $sr)
fi