All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Inga Stotland <inga.stotland@intel.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] shared/shell: Fix short option parsing
Date: Thu, 22 Mar 2018 12:30:31 +0200	[thread overview]
Message-ID: <CABBYNZLd0rhkcVyCr4sJEOnYkdY-vJhc34UHfQZaN44v23OQew@mail.gmail.com> (raw)
In-Reply-To: <20180322031300.32156-1-inga.stotland@intel.com>

Hi Inga,

On Thu, Mar 22, 2018 at 5:13 AM, Inga Stotland <inga.stotland@intel.com> wrote:
> The index value used for detecting and validating a short option
> was not reset after processing a first short option.
> This prevented the correct parsing of additional short options.
> Fixed by resetting the index value back to original after each
> iteration.
> ---
>  src/shared/shell.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/shared/shell.c b/src/shared/shell.c
> index 9cd8d2567..10f26264f 100644
> --- a/src/shared/shell.c
> +++ b/src/shared/shell.c
> @@ -957,6 +957,8 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt)
>
>                         *opt->optarg[index - offset] = optarg;
>                 }
> +
> +               index = -1;
>         }
>
>         data.argc = argc - optind;
> --
> 2.13.6

Applied, thanks.

-- 
Luiz Augusto von Dentz

           reply	other threads:[~2018-03-22 10:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20180322031300.32156-1-inga.stotland@intel.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABBYNZLd0rhkcVyCr4sJEOnYkdY-vJhc34UHfQZaN44v23OQew@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=inga.stotland@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.