[Pixman] [PATCH] lowlevel-blt-bench: make extra arguments an error

Pekka Paalanen ppaalanen at gmail.com
Tue Aug 18 01:35:54 PDT 2015


On Tue,  7 Jul 2015 11:35:04 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> If a user gives multiple patterns or extra arguments, only the last one
> was used as the pattern while the former were just ignored. This is a
> user error silently converted to something possibly unexpected.
> 
> In presence of extra arguments, complain and quit.
> 
> Cc: Ben Avison <bavison at riscosopen.org>
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
>  test/lowlevel-blt-bench.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
> index fc7472f..28ff669 100644
> --- a/test/lowlevel-blt-bench.c
> +++ b/test/lowlevel-blt-bench.c
> @@ -1122,6 +1122,12 @@ main (int argc, char *argv[])
>  	}
>  	else
>  	{
> +	    if (pattern)
> +	    {
> +		pattern = NULL;
> +		printf ("Error: extra arguments given.\n");
> +		break;
> +	    }
>  	    pattern = argv[i];
>  	}
>      }

Hi,

since no-one objected and this is quite trivial, pushed:
   6961147..fd59569  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20150818/0b9481d4/attachment.sig>


More information about the Pixman mailing list