OSDN Git Service

Consolidate bash version checks
authorJames Roberts-Thomson <jamesrt@gmail.com>
Tue, 16 Apr 2013 03:53:39 +0000 (15:53 +1200)
committerMichael Bestas <mikeioannina@gmail.com>
Sat, 31 Dec 2016 18:25:36 +0000 (20:25 +0200)
There were two checks for bash version, the 2nd was superfluous; this
patch removes the duplicate checks, and shifts the bash version check to
being back after the "are we in bash" check.

Change-Id: I57ff8c1fedce80f739c06643d2976d2c1465db1b

envsetup.sh

index 22f0933..aa27b24 100644 (file)
@@ -334,18 +334,18 @@ function settitle()
 
 function addcompletions()
 {
-    local T dir f
-
     # Keep us from trying to run in something that isn't bash.
     if [ -z "${BASH_VERSION}" ]; then
         return
     fi
 
     # Keep us from trying to run in bash that's too old.
-    if [ ${BASH_VERSINFO[0]} -lt 3 ]; then
+    if [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then
         return
     fi
 
+    local T dir f
+
     dirs="sdk/bash_completion vendor/cm/bash_completion"
     for dir in $dirs; do
     if [ -d ${dir} ]; then