From 8dee4e4961e53e6e55f13763a0a101982dff6e11 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 16 Sep 2018 16:50:19 -0700 Subject: [PATCH] Fix bash completion on mac. For some bizarro reason, mac's bash doesn't like negative indexes, even though its version of bash should support it. --- src/etc/cargo.bashcomp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/cargo.bashcomp.sh b/src/etc/cargo.bashcomp.sh index bed72cc80ad..3d8ed1d771b 100644 --- a/src/etc/cargo.bashcomp.sh +++ b/src/etc/cargo.bashcomp.sh @@ -125,7 +125,7 @@ __cargo_commands=$(cargo --list 2>/dev/null | tail -n +2) _locate_manifest(){ local manifest=`cargo locate-project 2>/dev/null` # regexp-replace manifest '\{"root":"|"\}' '' - echo ${manifest:9:-2} + echo ${manifest:9:${#manifest}-11} } # Extracts the values of "name" from the array given in $1 and shows them as