summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-07-07 11:31:20 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-08-18 10:23:27 +0300
commitfd595692941f3d9ddea8934462bd1d18aed07c65 (patch)
tree3b2579c6eacc677bb2e6af6554b8a03f93ca92b1
parent69611473c5a4e7cc2e6016d82ff4ed28e289484a (diff)
lowlevel-blt-bench: make extra arguments an error
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@riscosopen.org> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--test/lowlevel-blt-bench.c6
1 files changed, 6 insertions, 0 deletions
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];
}
}