aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lexer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lexer.c b/src/lexer.c
index a967c25..2076d20 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -124,18 +124,6 @@ found_start:
}
directive->operands = operand;
- } else if (strncmp(buffer + n, "content ", strlen("content")) == 0) {
- directive->type = CONTENT;
-
- char *operand = NULL;
- for (size_t i = n + strlen("content"); i < match->length - n; i++)
- if (isalnum(buffer[i])) {
- sscanf(buffer + i, "%ms\"", &operand);
- operand[strlen(operand) - 1] = '\0';
- break;
- }
-
- directive->operands = operand;
} else if (strncmp(buffer + n, "endcontent", strlen("endcontent")) == 0) {
directive->type = ENDCONTENT;
directive->operands = NULL;
@@ -194,6 +182,18 @@ found_start:
free(new_match);
directive->operands = operands;
+ } else if (strncmp(buffer + n, "content ", strlen("content")) == 0) {
+ directive->type = CONTENT;
+
+ char *operand = NULL;
+ for (size_t i = n + strlen("content"); i < match->length - n; i++)
+ if (isalnum(buffer[i])) {
+ sscanf(buffer + i, "%ms\"", &operand);
+ operand[strlen(operand) - 1] = '\0';
+ break;
+ }
+
+ directive->operands = operand;
} else {
free(directive);
return NULL;