[PATCH] utilities: kernelscan: Add in missing [ ] brackets tokenisation

Colin King colin.king at canonical.com
Fri Jul 1 10:14:10 UTC 2016


From: Colin Ian King <colin.king at canonical.com>

Forgot to handle [ ] tokenisation

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/utilities/kernelscan.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/utilities/kernelscan.c b/src/utilities/kernelscan.c
index d1bebdd..aa4d819 100644
--- a/src/utilities/kernelscan.c
+++ b/src/utilities/kernelscan.c
@@ -68,6 +68,8 @@ typedef enum {
 	TOKEN_IDENTIFIER,	/* identifier */
 	TOKEN_PAREN_OPENED,	/* ( */
 	TOKEN_PAREN_CLOSED,	/* ) */
+	TOKEN_SQUARE_OPENED,	/* [ */
+	TOKEN_SQUARE_CLOSED,	/* ] */
 	TOKEN_CPP,		/* # C pre-propressor */
 	TOKEN_WHITE_SPACE,	/* ' ', '\t', '\r', '\n' white space */
 	TOKEN_LESS_THAN,	/* < */
@@ -777,6 +779,14 @@ static int get_token(parser *p, token *t)
 			token_append(t, ch);
 			t->type = TOKEN_PAREN_CLOSED;
 			return PARSER_OK;
+		case '[':
+			token_append(t, ch);
+			t->type = TOKEN_SQUARE_OPENED;
+			return PARSER_OK;
+		case ']':
+			token_append(t, ch);
+			t->type = TOKEN_SQUARE_CLOSED;
+			return PARSER_OK;
 		case '<':
 			token_append(t, ch);
 			t->type = TOKEN_LESS_THAN;
-- 
2.8.1




More information about the fwts-devel mailing list