From a7580a1eae5a5fe8f2a7e70a1447009fed91645e Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Wed, 4 Feb 2015 09:33:14 +0100 Subject: added actual tests and fixed reset-exclude funtction --- src/modules/systemlib/param/param.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c index 7ff71a802..926ae75a7 100644 --- a/src/modules/systemlib/param/param.c +++ b/src/modules/systemlib/param/param.c @@ -504,15 +504,22 @@ param_reset_excludes(const char* excludes[], int num_excludes) for (param = 0; handle_in_range(param); param++) { const char* name = param_name(param); + bool exclude = false; + + for (int index = 0; index < num_excludes; index ++) { + int len = strlen(excludes[index]); - for (int index = 0, len = strlen(excludes[index]); index < num_excludes; index ++) { if((excludes[index][len - 1] == '*' - && strncmp(name, excludes[index], len - 1)) == 0 + && strncmp(name, excludes[index], len - 1) == 0) || strcmp(name, excludes[index]) == 0) { - - param_reset(param); + exclude = true; + break; } } + + if(!exclude) { + param_reset(param); + } } param_unlock(); -- cgit v1.2.3