Skip to content

Commit 0cbd3d2

Browse files
committed
Add missing include
1 parent 3f97c63 commit 0cbd3d2

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

libyara/re_lexer.c

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ limitations under the License.
513513
#include <yara/mem.h>
514514
#include <yara/re.h>
515515
#include <yara/re_lexer.h>
516+
#include <yara/strutils.h>
516517

517518

518519
#ifdef _WIN32
@@ -525,7 +526,7 @@ uint8_t read_escaped_char(yyscan_t yyscanner);
525526

526527
#define YY_NO_UNISTD_H 1
527528

528-
#line 529 "re_lexer.c"
529+
#line 530 "re_lexer.c"
529530

530531
#define INITIAL 0
531532
#define char_class 1
@@ -757,10 +758,10 @@ YY_DECL
757758
register int yy_act;
758759
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
759760

760-
#line 60 "re_lexer.l"
761+
#line 61 "re_lexer.l"
761762

762763

763-
#line 764 "re_lexer.c"
764+
#line 765 "re_lexer.c"
764765

765766
yylval = yylval_param;
766767

@@ -859,7 +860,7 @@ YY_DECL
859860

860861
case 1:
861862
YY_RULE_SETUP
862-
#line 62 "re_lexer.l"
863+
#line 63 "re_lexer.l"
863864
{
864865

865866
// Examples: {3,8} {0,5} {,5} {7,}
@@ -895,7 +896,7 @@ YY_RULE_SETUP
895896
YY_BREAK
896897
case 2:
897898
YY_RULE_SETUP
898-
#line 96 "re_lexer.l"
899+
#line 97 "re_lexer.l"
899900
{
900901

901902
// Example: {10}
@@ -915,7 +916,7 @@ YY_RULE_SETUP
915916
YY_BREAK
916917
case 3:
917918
YY_RULE_SETUP
918-
#line 114 "re_lexer.l"
919+
#line 115 "re_lexer.l"
919920
{
920921

921922
// Start of a negated character class. Example: [^abcd]
@@ -927,7 +928,7 @@ YY_RULE_SETUP
927928
YY_BREAK
928929
case 4:
929930
YY_RULE_SETUP
930-
#line 123 "re_lexer.l"
931+
#line 124 "re_lexer.l"
931932
{
932933

933934
// Start of character negated class containing a ].
@@ -942,7 +943,7 @@ YY_RULE_SETUP
942943
YY_BREAK
943944
case 5:
944945
YY_RULE_SETUP
945-
#line 136 "re_lexer.l"
946+
#line 137 "re_lexer.l"
946947
{
947948

948949
// Start of character class containing a ].
@@ -957,7 +958,7 @@ YY_RULE_SETUP
957958
YY_BREAK
958959
case 6:
959960
YY_RULE_SETUP
960-
#line 149 "re_lexer.l"
961+
#line 150 "re_lexer.l"
961962
{
962963

963964
// Start of character class. Example: [abcd]
@@ -970,7 +971,7 @@ YY_RULE_SETUP
970971
case 7:
971972
/* rule 7 can match eol */
972973
YY_RULE_SETUP
973-
#line 159 "re_lexer.l"
974+
#line 160 "re_lexer.l"
974975
{
975976

976977
// Any non-special character is passed as a CHAR token to the scanner.
@@ -981,49 +982,49 @@ YY_RULE_SETUP
981982
YY_BREAK
982983
case 8:
983984
YY_RULE_SETUP
984-
#line 168 "re_lexer.l"
985+
#line 169 "re_lexer.l"
985986
{
986987
return _WORD_CHAR_;
987988
}
988989
YY_BREAK
989990
case 9:
990991
YY_RULE_SETUP
991-
#line 173 "re_lexer.l"
992+
#line 174 "re_lexer.l"
992993
{
993994
return _NON_WORD_CHAR_;
994995
}
995996
YY_BREAK
996997
case 10:
997998
YY_RULE_SETUP
998-
#line 178 "re_lexer.l"
999+
#line 179 "re_lexer.l"
9991000
{
10001001
return _SPACE_;
10011002
}
10021003
YY_BREAK
10031004
case 11:
10041005
YY_RULE_SETUP
1005-
#line 183 "re_lexer.l"
1006+
#line 184 "re_lexer.l"
10061007
{
10071008
return _NON_SPACE_;
10081009
}
10091010
YY_BREAK
10101011
case 12:
10111012
YY_RULE_SETUP
1012-
#line 188 "re_lexer.l"
1013+
#line 189 "re_lexer.l"
10131014
{
10141015
return _DIGIT_;
10151016
}
10161017
YY_BREAK
10171018
case 13:
10181019
YY_RULE_SETUP
1019-
#line 193 "re_lexer.l"
1020+
#line 194 "re_lexer.l"
10201021
{
10211022
return _NON_DIGIT_;
10221023
}
10231024
YY_BREAK
10241025
case 14:
10251026
YY_RULE_SETUP
1026-
#line 198 "re_lexer.l"
1027+
#line 199 "re_lexer.l"
10271028
{
10281029

10291030
yyerror(yyscanner, lex_env, "backreferences are not allowed");
@@ -1032,15 +1033,15 @@ YY_RULE_SETUP
10321033
YY_BREAK
10331034
case 15:
10341035
YY_RULE_SETUP
1035-
#line 205 "re_lexer.l"
1036+
#line 206 "re_lexer.l"
10361037
{
10371038
yylval->integer = read_escaped_char(yyscanner);
10381039
return _CHAR_;
10391040
}
10401041
YY_BREAK
10411042
case 16:
10421043
YY_RULE_SETUP
1043-
#line 211 "re_lexer.l"
1044+
#line 212 "re_lexer.l"
10441045
{
10451046

10461047
// End of character class.
@@ -1063,7 +1064,7 @@ YY_RULE_SETUP
10631064
case 17:
10641065
/* rule 17 can match eol */
10651066
YY_RULE_SETUP
1066-
#line 232 "re_lexer.l"
1067+
#line 233 "re_lexer.l"
10671068
{
10681069

10691070
// A range inside a character class.
@@ -1102,7 +1103,7 @@ YY_RULE_SETUP
11021103
YY_BREAK
11031104
case 18:
11041105
YY_RULE_SETUP
1105-
#line 269 "re_lexer.l"
1106+
#line 270 "re_lexer.l"
11061107
{
11071108

11081109
int i;
@@ -1117,7 +1118,7 @@ YY_RULE_SETUP
11171118
YY_BREAK
11181119
case 19:
11191120
YY_RULE_SETUP
1120-
#line 282 "re_lexer.l"
1121+
#line 283 "re_lexer.l"
11211122
{
11221123

11231124
int i;
@@ -1132,7 +1133,7 @@ YY_RULE_SETUP
11321133
YY_BREAK
11331134
case 20:
11341135
YY_RULE_SETUP
1135-
#line 295 "re_lexer.l"
1136+
#line 296 "re_lexer.l"
11361137
{
11371138

11381139
LEX_ENV->class_vector[' ' / 8] |= 1 << ' ' % 8;
@@ -1141,7 +1142,7 @@ YY_RULE_SETUP
11411142
YY_BREAK
11421143
case 21:
11431144
YY_RULE_SETUP
1144-
#line 302 "re_lexer.l"
1145+
#line 303 "re_lexer.l"
11451146
{
11461147

11471148
int i;
@@ -1155,7 +1156,7 @@ YY_RULE_SETUP
11551156
YY_BREAK
11561157
case 22:
11571158
YY_RULE_SETUP
1158-
#line 314 "re_lexer.l"
1159+
#line 315 "re_lexer.l"
11591160
{
11601161

11611162
char c;
@@ -1166,7 +1167,7 @@ YY_RULE_SETUP
11661167
YY_BREAK
11671168
case 23:
11681169
YY_RULE_SETUP
1169-
#line 323 "re_lexer.l"
1170+
#line 324 "re_lexer.l"
11701171
{
11711172

11721173
int i;
@@ -1181,7 +1182,7 @@ YY_RULE_SETUP
11811182
YY_BREAK
11821183
case 24:
11831184
YY_RULE_SETUP
1184-
#line 336 "re_lexer.l"
1185+
#line 337 "re_lexer.l"
11851186
{
11861187

11871188
uint8_t c = read_escaped_char(yyscanner);
@@ -1190,7 +1191,7 @@ YY_RULE_SETUP
11901191
YY_BREAK
11911192
case 25:
11921193
YY_RULE_SETUP
1193-
#line 343 "re_lexer.l"
1194+
#line 344 "re_lexer.l"
11941195
{
11951196

11961197
if (yytext[0] >= 32 && yytext[0] < 127)
@@ -1208,7 +1209,7 @@ YY_RULE_SETUP
12081209
}
12091210
YY_BREAK
12101211
case YY_STATE_EOF(char_class):
1211-
#line 360 "re_lexer.l"
1212+
#line 361 "re_lexer.l"
12121213
{
12131214

12141215
// End of regexp reached while scanning a character class.
@@ -1219,7 +1220,7 @@ case YY_STATE_EOF(char_class):
12191220
YY_BREAK
12201221
case 26:
12211222
YY_RULE_SETUP
1222-
#line 369 "re_lexer.l"
1223+
#line 370 "re_lexer.l"
12231224
{
12241225

12251226
if (yytext[0] >= 32 && yytext[0] < 127)
@@ -1234,18 +1235,18 @@ YY_RULE_SETUP
12341235
}
12351236
YY_BREAK
12361237
case YY_STATE_EOF(INITIAL):
1237-
#line 383 "re_lexer.l"
1238+
#line 384 "re_lexer.l"
12381239
{
12391240

12401241
yyterminate();
12411242
}
12421243
YY_BREAK
12431244
case 27:
12441245
YY_RULE_SETUP
1245-
#line 388 "re_lexer.l"
1246+
#line 389 "re_lexer.l"
12461247
ECHO;
12471248
YY_BREAK
1248-
#line 1249 "re_lexer.c"
1249+
#line 1250 "re_lexer.c"
12491250

12501251
case YY_END_OF_BUFFER:
12511252
{
@@ -2378,7 +2379,7 @@ void re_yyfree (void * ptr , yyscan_t yyscanner)
23782379

23792380
#define YYTABLES_NAME "yytables"
23802381

2381-
#line 388 "re_lexer.l"
2382+
#line 389 "re_lexer.l"
23822383

23832384

23842385

libyara/re_lexer.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ limitations under the License.
2828
#include <yara/mem.h>
2929
#include <yara/re.h>
3030
#include <yara/re_lexer.h>
31+
#include <yara/strutils.h>
3132

3233

3334
#ifdef _WIN32

0 commit comments

Comments
 (0)