Patchwork [enhancement,3] bash_completion Be compatible with “set -u”

login
register
mail settings
Submitter Roland Eggner
Date Dec. 30, 2013, 7:15 p.m.
Message ID <20131230191527.GF23913@mobil.systemanalysen.net>
Download mbox | patch
Permalink /patch/3245/
State Superseded
Headers show

Comments

Roland Eggner - Dec. 30, 2013, 7:15 p.m.
# HG changeset patch
# Parent 81e0cc02b93d4a07a05ac83803b4ef6c4c61c596
[enhancement 3] bash_completion  Be compatible with “set -u”.

Patch

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -179,7 +179,7 @@  shopt -s extglob
 	;;
     esac
 
-    if [ -z "$cmd" ] || [ $COMP_CWORD -eq $i ]; then
+    if [[ -z "${cmd-}" ]] || [ $COMP_CWORD -eq $i ]; then
 	_hg_commands
 	return
     fi