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

Roland Eggner edvx1 at systemanalysen.net
Mon Dec 30 13:15:28 CST 2013


# HG changeset patch
# Parent 81e0cc02b93d4a07a05ac83803b4ef6c4c61c596
[enhancement 3] 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/20131230/4c54055c/attachment.pgp>


More information about the Mercurial-devel mailing list