X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Ffilter%2Ffilter-visitor-ir-validate-string.c;h=1df83b03fb3711466378da2492ec0169c67190b5;hp=34b4b194b5083de014de21c1610c8a1e482bcc97;hb=25357057de5ae4dd2a572e8f9b893c1b90cbd60a;hpb=dcd5daf2e2acb0745d5e6ff66185147007e8ed53 diff --git a/src/lib/lttng-ctl/filter/filter-visitor-ir-validate-string.c b/src/lib/lttng-ctl/filter/filter-visitor-ir-validate-string.c index 34b4b194b..1df83b03f 100644 --- a/src/lib/lttng-ctl/filter/filter-visitor-ir-validate-string.c +++ b/src/lib/lttng-ctl/filter/filter-visitor-ir-validate-string.c @@ -3,20 +3,10 @@ * * LTTng filter IR validate string * - * Copyright 2014 - Jérémie Galarneau + * Copyright 2014 Jérémie Galarneau * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License, version 2.1 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -26,6 +16,9 @@ #include #include #include + +#include + #include "filter-ast.h" #include "filter-parser.h" #include "filter-ir.h" @@ -74,13 +67,9 @@ int validate_string(struct ir_op *node) if (node->data_type == IR_DATA_STRING) { const char *str; - assert(node->u.load.u.string); - str = node->u.load.u.string; + assert(node->u.load.u.string.value); + str = node->u.load.u.string.value; - /* - * Make sure that if a non-escaped wildcard is - * present, it is the last character of the string. - */ for (;;) { enum parse_char_result res; @@ -92,20 +81,6 @@ int validate_string(struct ir_op *node) str++; switch (res) { - case PARSE_CHAR_WILDCARD: - { - if (*str) { - /* - * Found a wildcard followed by non-null - * character; unsupported. - */ - ret = -EINVAL; - fprintf(stderr, - "Wildcards may only be used as the last character of a string in a filter.\n"); - goto end_load; - } - break; - } case PARSE_CHAR_UNKNOWN: ret = -EINVAL; fprintf(stderr, @@ -142,6 +117,7 @@ end_load: } } +LTTNG_HIDDEN int filter_visitor_ir_validate_string(struct filter_parser_ctx *ctx) { return validate_string(ctx->ir_root);