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

Roland Eggner edvx1 at systemanalysen.net
Mon Dec 30 19:45:31 CST 2013


# HG changeset patch
# Parent aacff37a76a4d952e3154fd5d67837c24767f281
bash_completion: be compatible with “set -u”

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131231/ee770238/attachment.pgp>


More information about the Mercurial-devel mailing list