summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-05-10 15:31:26 +0200
committerDave Reisner <dreisner@archlinux.org>2014-09-22 14:25:43 +0200
commit98841eb694fa3cd575fde60e562586cf33415c5b (patch)
treecf4c641b75450bcd2a9e0d1f39803fc8a77a030b /lib
parentbe00fcd47b9fa6ebdab7173372ab219514e0b88d (diff)
downloaddevtools-98841eb694fa3cd575fde60e562586cf33415c5b.tar.gz
devtools-98841eb694fa3cd575fde60e562586cf33415c5b.tar.xz
common: remove unreachable statement
We run from a non-interactive shell, so the exec which is inevitably called will replace the current process and 'die' will never run under any circumstances. This also fixes a bug with the su fallback which would cause multiple arguments to be concatenated without any whitespace between them.
Diffstat (limited to 'lib')
-rw-r--r--lib/common.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 104850b..f6aea93 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -238,7 +238,6 @@ check_root() {
if type -P sudo >/dev/null; then
exec sudo -- "$@"
else
- exec su root -c "$(printf '%q' "$@")"
+ exec su root -c "$(printf ' %q' "$@")"
fi
- die 'This script must be run as root.'
}