monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: 048c373451e7a1dab9865f8508


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 048c373451e7a1dab9865f85088d79defdc737d7
Date: Tue, 22 Feb 2011 16:42:11 +0100 (CET)

revision:            048c373451e7a1dab9865f85088d79defdc737d7
date:                2011-02-22T15:41:49
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
* extra/shell/monotone.bash_completion.in (_monotone): Make sure there
  will be no array index error.  This can occur if the user starts a
  non-existent command and then presses TAB.

manifest:
format_version "1"

new_manifest [fb33c53864879bda23f4b11f0874dd2be2b63827]

old_revision [49b0606881e3d70438ca13698f8e60969d70fb0b]

patch "extra/shell/monotone.bash_completion.in"
 from [f7d35f2c13c6babc009800a11f6eff1eb69b01d9]
   to [a878e6fa815f84f18961fb2366d0235376be8c29]
============================================================
--- extra/shell/monotone.bash_completion.in	f7d35f2c13c6babc009800a11f6eff1eb69b01d9
+++ extra/shell/monotone.bash_completion.in	a878e6fa815f84f18961fb2366d0235376be8c29
@@ -281,9 +281,10 @@ _monotone() {
 		elif [ $arg_cword -ge 0 ]; then
 		    local args=( ${_monotone_command_args[$cmd_line]} )
 		    local argtype=${args[$arg_cword]}
-		    if [ "$argtype" = "..." ]; then
+		    if [ $arg_cword -ge 1 ] && [ "$argtype" = "..." ]; then
 			argtype=${args[$arg_cword-1]}
-		    elif [ -z "$argtype" -a "${args[${#args[*]}-1]}" = "..." ]; then
+		    elif [ ${#args[*]} -ge 2 ] && \
+			[ -z "$argtype" -a "${args[${#args[*]}-1]}" = "..." ]; then
 			argtype=${args[${#args[*]}-2]}
 		    fi
 		    case $argtype in

reply via email to

[Prev in Thread] Current Thread [Next in Thread]