From ab6d0fe33f57bb305b8d7e5f8bed0642d1b099d5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 14 Oct 2017 22:59:55 +0200 Subject: [PATCH] subcommand: Declare $opt as local. Without the local keyword, gsu_cword_is_option_parameter() might overwrite a variable of the caller. --- subcommand | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subcommand b/subcommand index c04f23f..7318c9e 100644 --- a/subcommand +++ b/subcommand @@ -493,7 +493,8 @@ EOF # gsu_cword_is_option_parameter() { - local opts="$1" cword="$2" prev i n + local opts="$1" cword="$2" + local opt prev i n local -a words result= -- 2.39.5