public inbox for xenomai@lists.linux.dev
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Tobias Schaffner <tobias.schaffner@siemens.com>
Cc: xenomai@lists.linux.dev
Subject: Re: [PATCH libevl] evl-test: fix opt parsing ignoring shifts
Date: Thu, 22 Jan 2026 19:44:19 +0100	[thread overview]
Message-ID: <87wm19ij24.fsf@xenomai.org> (raw)
In-Reply-To: <20260116084112.2303951-1-tobias.schaffner@siemens.com> (Tobias Schaffner's message of "Fri, 16 Jan 2026 09:41:12 +0100")

Tobias Schaffner <tobias.schaffner@siemens.com> writes:

> The for loop used for opt parsing copies the list before iterating over
> its elements. Use a while loop to make the shift calls work as expected.
>
> Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
> ---
>  utils/evl-test | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/utils/evl-test b/utils/evl-test
> index 0d0ca81..f17a781 100644
> --- a/utils/evl-test
> +++ b/utils/evl-test
> @@ -18,12 +18,13 @@ test_args=false
>  test_arg_list=
>  test_list=
>  
> -for opt
> +while test $# -gt 0
>  do
>      if test x$test_args = xtrue; then
> -	test_arg_list="$test_arg_list $opt"
> +	test_arg_list="$test_arg_list $1"
> +	shift
>      else
> -	case "$opt" in
> +	case "$1" in
>  	    -k) keep_going=true;
>  		shift;;
>  	    -h) help=true;
> @@ -39,7 +40,8 @@ do
>  	        exit 0;;
>  	    -*) usage $0
>  		exit 1;;
> -	    *)  test_list="$test_list $(eval echo $EVL_TESTDIR/$opt)"
> +	    *)  test_list="$test_list $(eval echo $EVL_TESTDIR/$1)"
> +		shift;;
>  	esac
>      fi
>  done

Merged (along with the typo fix in the help string), thanks.

-- 
Philippe.

      reply	other threads:[~2026-01-22 18:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  8:41 [PATCH libevl] evl-test: fix opt parsing ignoring shifts Tobias Schaffner
2026-01-22 18:44 ` Philippe Gerum [this message]

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=87wm19ij24.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=tobias.schaffner@siemens.com \
    --cc=xenomai@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox