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

login
register
mail settings
Submitter Roland Eggner
Date Dec. 31, 2013, 1:45 a.m.
Message ID <20131231014531.GN23913@mobil.systemanalysen.net>
Download mbox | patch
Permalink /patch/3251/
State Superseded
Headers show

Comments

Roland Eggner - Dec. 31, 2013, 1:45 a.m.
# HG changeset patch
# Parent aacff37a76a4d952e3154fd5d67837c24767f281
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