]> git.sur5r.net Git - i3/i3/commitdiff
Quote the variables in i3-sensible-* correctly 2087/head
authorTobias Bucher <tobiasbucher5991@gmail.com>
Tue, 24 Nov 2015 13:15:31 +0000 (13:15 +0000)
committerTobias Bucher <tobiasbucher5991@gmail.com>
Mon, 30 Nov 2015 21:36:23 +0000 (21:36 +0000)
Previously, the variables $EDITOR, $PAGER, $TERMINAL and $VISUAL got
shell-expanded twice before executing them.

i3-sensible-editor
i3-sensible-pager
i3-sensible-terminal

index 4e7456b705129a9ea022d073efe51b6e21946abb..861615f3fc8707b5fc7cb83e0337c18cedf1b760 100755 (executable)
@@ -9,8 +9,8 @@
 # mechanism to find the preferred editor
 
 # Hopefully one of these is installed (no flamewars about preference please!):
 # mechanism to find the preferred editor
 
 # Hopefully one of these is installed (no flamewars about preference please!):
-for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do
-    if command -v $editor > /dev/null 2>&1; then
-        exec $editor "$@"
+for editor in "$VISUAL" "$EDITOR" nano vim vi emacs pico qe mg jed gedit mc-edit; do
+    if command -v "$editor" > /dev/null 2>&1; then
+        exec "$editor" "$@"
     fi
 done
     fi
 done
index ce71686bd01182ec79651f2d46c078fe7ce36c11..386e29886ff82d29e8a56034eacfcfe87ce5eaac 100755 (executable)
@@ -11,8 +11,8 @@
 # Hopefully one of these is installed (no flamewars about preference please!):
 # We don't use 'more' because it will exit if the file is too short.
 # Worst case scenario we'll open the file in your editor.
 # Hopefully one of these is installed (no flamewars about preference please!):
 # We don't use 'more' because it will exit if the file is too short.
 # Worst case scenario we'll open the file in your editor.
-for pager in $PAGER less most w3m pg i3-sensible-editor; do
-    if command -v $pager > /dev/null 2>&1; then
-        exec $pager "$@"
+for pager in "$PAGER" less most w3m pg i3-sensible-editor; do
+    if command -v "$pager" > /dev/null 2>&1; then
+        exec "$pager" "$@"
     fi
 done
     fi
 done
index c80e5ee211b785e1f4dc59efc4501c73d5b44bcb..bb66f02b55908fb423c0c214bcdac2b4360c8fbe 100755 (executable)
@@ -8,9 +8,9 @@
 # We welcome patches that add distribution-specific mechanisms to find the
 # preferred terminal emulator. On Debian, there is the x-terminal-emulator
 # symlink for example.
 # We welcome patches that add distribution-specific mechanisms to find the
 # preferred terminal emulator. On Debian, there is the x-terminal-emulator
 # symlink for example.
-for terminal in $TERMINAL x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do
-    if command -v $terminal > /dev/null 2>&1; then
-        exec $terminal "$@"
+for terminal in "$TERMINAL" x-terminal-emulator urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology; do
+    if command -v "$terminal" > /dev/null 2>&1; then
+        exec "$terminal" "$@"
     fi
 done
 
     fi
 done